mirror of
https://github.com/aikar/commands.git
synced 2026-06-10 02:07:36 +00:00
Make InvalidCommandArgument a runtime exception
This commit is contained in:
@@ -26,7 +26,7 @@ package co.aikar.commands;
|
||||
import co.aikar.locales.MessageKey;
|
||||
import co.aikar.locales.MessageKeyProvider;
|
||||
|
||||
public class InvalidCommandArgument extends Exception {
|
||||
public class InvalidCommandArgument extends RuntimeException {
|
||||
final boolean showSyntax;
|
||||
final MessageKey key;
|
||||
final String[] replacements;
|
||||
@@ -34,18 +34,23 @@ public class InvalidCommandArgument extends Exception {
|
||||
public InvalidCommandArgument() {
|
||||
this(null, true);
|
||||
}
|
||||
|
||||
public InvalidCommandArgument(boolean showSyntax) {
|
||||
this(null, showSyntax);
|
||||
}
|
||||
|
||||
public InvalidCommandArgument(MessageKeyProvider key, String... replacements) {
|
||||
this(key.getMessageKey(), replacements);
|
||||
}
|
||||
|
||||
public InvalidCommandArgument(MessageKey key, String... replacements) {
|
||||
this(key, true, replacements);
|
||||
}
|
||||
|
||||
public InvalidCommandArgument(MessageKeyProvider key, boolean showSyntax, String... replacements) {
|
||||
this(key.getMessageKey(), showSyntax, replacements);
|
||||
}
|
||||
|
||||
public InvalidCommandArgument(MessageKey key, boolean showSyntax, String... replacements) {
|
||||
super(key.getKey(), null, false, false);
|
||||
this.showSyntax = showSyntax;
|
||||
@@ -54,7 +59,7 @@ public class InvalidCommandArgument extends Exception {
|
||||
}
|
||||
|
||||
public InvalidCommandArgument(String message) {
|
||||
this(message, true);
|
||||
this(message, true);
|
||||
}
|
||||
|
||||
public InvalidCommandArgument(String message, boolean showSyntax) {
|
||||
|
||||
Reference in New Issue
Block a user