mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-07 16:57:42 +01:00
Fail silently on incorrect number input
By: feildmaster <admin@feildmaster.com>
This commit is contained in:
parent
d63210b3ec
commit
d6f528e808
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user