mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-18 00:25:24 +01:00
Add arglength checking for /npc command clearerror
This commit is contained in:
parent
bbf7ca2f98
commit
353699fe80
@ -441,6 +441,10 @@ public class NPCCommands {
|
|||||||
throw new CommandException(CommandMessages.INVALID_NUMBER);
|
throw new CommandException(CommandMessages.INVALID_NUMBER);
|
||||||
}
|
}
|
||||||
} else if (action.equalsIgnoreCase("clearerror")) {
|
} else if (action.equalsIgnoreCase("clearerror")) {
|
||||||
|
if (args.argsLength() < 3)
|
||||||
|
throw new CommandException(Messages.NPC_COMMAND_INVALID_ERROR_MESSAGE,
|
||||||
|
Util.listValuesPretty(CommandTraitError.values()));
|
||||||
|
|
||||||
CommandTraitError which = Util.matchEnum(CommandTraitError.values(), args.getString(2));
|
CommandTraitError which = Util.matchEnum(CommandTraitError.values(), args.getString(2));
|
||||||
if (which == null)
|
if (which == null)
|
||||||
throw new CommandException(Messages.NPC_COMMAND_INVALID_ERROR_MESSAGE,
|
throw new CommandException(Messages.NPC_COMMAND_INVALID_ERROR_MESSAGE,
|
||||||
|
Loading…
Reference in New Issue
Block a user