Fixed an error when setting exp to 0

This commit is contained in:
Indyuce 2022-06-04 12:17:33 +02:00
parent 9a08c142fb
commit 0ae7c3613d

View File

@ -58,8 +58,8 @@ public class ExperienceCommandTreeNode extends CommandTreeNode {
int amount;
try {
amount = Integer.parseInt(args[5]);
Validate.isTrue(amount > 0);
} catch (NumberFormatException exception) {
Validate.isTrue(amount >= 0);
} catch (RuntimeException exception) {
sender.sendMessage(ChatColor.RED + args[5] + " is not a valid number.");
return CommandResult.FAILURE;
}