diff options
author | feildmaster <admin@feildmaster.com> | 2012-08-06 03:14:26 -0500 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2012-08-06 06:59:45 -0500 |
commit | b374b3b2cd0cd61cc405bcb7bf6f939cffa141b0 (patch) | |
tree | fac9050e24f9d81066238591dca43254ae068a8a /src/main/java | |
parent | 9528f477270d68106bbfb30dffee89a60d5bc4a9 (diff) | |
download | bukkit-b374b3b2cd0cd61cc405bcb7bf6f939cffa141b0.tar bukkit-b374b3b2cd0cd61cc405bcb7bf6f939cffa141b0.tar.gz bukkit-b374b3b2cd0cd61cc405bcb7bf6f939cffa141b0.tar.lz bukkit-b374b3b2cd0cd61cc405bcb7bf6f939cffa141b0.tar.xz bukkit-b374b3b2cd0cd61cc405bcb7bf6f939cffa141b0.zip |
Fail silently on incorrect number input
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/bukkit/command/defaults/VanillaCommand.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/org/bukkit/command/defaults/VanillaCommand.java b/src/main/java/org/bukkit/command/defaults/VanillaCommand.java index 8a76ebed..bf6df750 100644 --- a/src/main/java/org/bukkit/command/defaults/VanillaCommand.java +++ b/src/main/java/org/bukkit/command/defaults/VanillaCommand.java @@ -26,11 +26,11 @@ public abstract class VanillaCommand extends Command { protected int getInteger(CommandSender sender, String value, int min, int max) { int i = min; + try { i = Integer.valueOf(value); - } catch (NumberFormatException ex) { - sender.sendMessage("Invalid exp count: " + value); - } + } catch (NumberFormatException ex) {} + if (i < min) { i = min; } else if (i > max) { |