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;
|
return true;
|
||||||
}
|
}
|
||||||
String ability = Methods.getAbility(abil);
|
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) {
|
if (slot < 1 || slot > 9) {
|
||||||
s.sendMessage(ChatColor.RED + "Slot must be an integer between 1 and 9.");
|
s.sendMessage(ChatColor.RED + "Slot must be an integer between 1 and 9.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Methods.hasPermission((Player) s, ability)) {
|
if (!Methods.hasPermission((Player) s, ability)) {
|
||||||
s.sendMessage(ChatColor.RED + "You don't have permission to do that.");
|
s.sendMessage(ChatColor.RED + "You don't have permission to do that.");
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
name: ProjectKorra
|
name: ProjectKorra
|
||||||
author: ProjectKorra
|
author: ProjectKorra
|
||||||
version: 1.2.0 BETA 1
|
version: 1.2.0 BETA 2
|
||||||
main: com.projectkorra.ProjectKorra.ProjectKorra
|
main: com.projectkorra.ProjectKorra.ProjectKorra
|
||||||
commands:
|
commands:
|
||||||
projectkorra:
|
projectkorra:
|
||||||
|
|
Loading…
Reference in a new issue