Tiny code cleanup

This commit is contained in:
libraryaddict 2014-05-24 05:01:51 +12:00
parent bff21ab039
commit 999c80076d

View File

@ -58,7 +58,7 @@ public class DisguiseRadiusCommand extends BaseDisguiseCommand {
} }
Class entityClass = Entity.class; Class entityClass = Entity.class;
int starting = 0; int starting = 0;
try { if (!isNumeric(args[0])) {
for (Class c : validClasses) { for (Class c : validClasses) {
if (c.getSimpleName().equalsIgnoreCase(args[0])) { if (c.getSimpleName().equalsIgnoreCase(args[0])) {
entityClass = c; entityClass = c;
@ -66,12 +66,11 @@ public class DisguiseRadiusCommand extends BaseDisguiseCommand {
break; break;
} }
} }
} catch (Exception ex) { if (starting == 0) {
}
if (starting == 0 && !isNumeric(args[0])) {
sender.sendMessage(ChatColor.RED + "Unrecognised EntityType " + args[0]); sender.sendMessage(ChatColor.RED + "Unrecognised EntityType " + args[0]);
return true; return true;
} }
}
if (args.length == starting + 1) { if (args.length == starting + 1) {
sender.sendMessage(ChatColor.RED + "You need to supply a disguise as well as the radius" sender.sendMessage(ChatColor.RED + "You need to supply a disguise as well as the radius"
+ (starting != 0 ? " and EntityType" : "")); + (starting != 0 ? " and EntityType" : ""));