mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-11 11:40:40 +00:00
Fix Error when binding move to slot using non-int
This commit is contained in:
parent
980574d412
commit
0b75442710
3 changed files with 9 additions and 3 deletions
Binary file not shown.
|
@ -170,12 +170,18 @@ public class Commands {
|
|||
return true;
|
||||
}
|
||||
String ability = Methods.getAbility(abil);
|
||||
int slot = Integer.parseInt(args[2]);
|
||||
int slot = 0;
|
||||
try {
|
||||
slot = Integer.parseInt(args[2]);
|
||||
} catch (NumberFormatException e) {
|
||||
s.sendMessage(ChatColor.RED + "Slot must be an integer between 1 and 9.");
|
||||
return true;
|
||||
}
|
||||
if (slot < 1 || slot > 9) {
|
||||
s.sendMessage(ChatColor.RED + "Slot must be an integer between 1 and 9.");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if (!Methods.hasPermission((Player) s, ability)) {
|
||||
s.sendMessage(ChatColor.RED + "You don't have permission to do that.");
|
||||
return true;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
name: ProjectKorra
|
||||
author: ProjectKorra
|
||||
version: 1.2.0 BETA 1
|
||||
version: 1.2.0 BETA 2
|
||||
main: com.projectkorra.ProjectKorra.ProjectKorra
|
||||
commands:
|
||||
projectkorra:
|
||||
|
|
Loading…
Reference in a new issue