Dedent parseDisguise() method for-loop

This commit is contained in:
riking 2014-06-04 09:18:05 -07:00
parent bb0ac727bf
commit 1207d70d6e

View File

@ -279,8 +279,14 @@ public abstract class BaseDisguiseCommand implements CommandExecutor {
if (!method.getName().startsWith("get") && method.getName().equalsIgnoreCase(methodName)
&& method.getAnnotation(Deprecated.class) == null && method.getParameterTypes().length == 1) {
methodToUse = method;
methodName = method.getName();
Class<?>[] types = method.getParameterTypes();
break;
}
}
if (methodToUse == null) {
throw new Exception(ChatColor.RED + "Cannot find the option " + methodName);
}
methodName = methodToUse.getName();
Class<?>[] types = methodToUse.getParameterTypes();
if (types.length == 1) {
Class param = types[0];
// Parse to number
@ -397,12 +403,6 @@ public abstract class BaseDisguiseCommand implements CommandExecutor {
}
}
}
break;
}
}
if (methodToUse == null) {
throw new Exception(ChatColor.RED + "Cannot find the option " + methodName);
}
if (!usedOptions.contains(methodName.toLowerCase())) {
usedOptions.add(methodName.toLowerCase());
}