mirror of
https://github.com/EpicEricEE/ShopChest.git
synced 2024-11-08 11:50:14 +01:00
Fix edit sub command for usage without amount
This commit is contained in:
parent
d1d6329efb
commit
9cf9d57c91
@ -82,12 +82,14 @@ public class EditSubCommand extends SubCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int amount = -1;
|
int amount = -1;
|
||||||
try {
|
if (amountArgs.size() > 0) {
|
||||||
amount = Integer.parseInt(amountArgs.get(0).split("=")[1]);
|
try {
|
||||||
if (amount <= 0) throw new NumberFormatException();
|
amount = Integer.parseInt(amountArgs.get(0).split("=")[1]);
|
||||||
} catch (NumberFormatException | IndexOutOfBoundsException e) {
|
if (amount <= 0) throw new NumberFormatException();
|
||||||
sender.sendMessage("§cThe amount you entered is not valid."); // i18n
|
} catch (NumberFormatException | IndexOutOfBoundsException e) {
|
||||||
return;
|
sender.sendMessage("§cThe amount you entered is not valid."); // i18n
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
double buyPrice = -1;
|
double buyPrice = -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user