Fixes various bugs in commands

This commit is contained in:
2022-02-27 12:47:05 +01:00
parent 0f958f0908
commit 91d477b45a
9 changed files with 153 additions and 46 deletions

View File

@ -22,7 +22,7 @@ public class AddCommand extends TokenizedCommand {
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label,
@NotNull String[] args) {
super.onCommand(sender, command, label, args);
if (args.length < 3) {
if (argumentSize < 2) {
return false;
}
@ -34,7 +34,10 @@ public class AddCommand extends TokenizedCommand {
sender.sendMessage("You provided an invalid number");
return false;
}
String permission = arguments.get(2);
String permission = "";
if (argumentSize > 2) {
permission = arguments.get(2);
}
OptionState ignoreCase = OptionState.DEFAULT;
OptionState ignoreColor = OptionState.DEFAULT;
if (argumentSize > 3) {