mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-19 13:38:44 +01:00
Fail silently on incorrect number input
By: feildmaster <admin@feildmaster.com>
This commit is contained in:
parent
d63210b3ec
commit
d6f528e808
1 changed files with 3 additions and 3 deletions
|
@ -26,11 +26,11 @@ public abstract class VanillaCommand extends Command {
|
||||||
|
|
||||||
protected int getInteger(CommandSender sender, String value, int min, int max) {
|
protected int getInteger(CommandSender sender, String value, int min, int max) {
|
||||||
int i = min;
|
int i = min;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
i = Integer.valueOf(value);
|
i = Integer.valueOf(value);
|
||||||
} catch (NumberFormatException ex) {
|
} catch (NumberFormatException ex) {}
|
||||||
sender.sendMessage("Invalid exp count: " + value);
|
|
||||||
}
|
|
||||||
if (i < min) {
|
if (i < min) {
|
||||||
i = min;
|
i = min;
|
||||||
} else if (i > max) {
|
} else if (i > max) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue