Fix Error when binding move to slot using non-int

This commit is contained in:
MistPhizzle 2014-07-07 21:17:36 -04:00
parent 980574d412
commit 0b75442710
3 changed files with 9 additions and 3 deletions

Binary file not shown.

View file

@ -170,7 +170,13 @@ 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;

View file

@ -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: