mirror of
https://github.com/libraryaddict/LibsDisguises.git
synced 2024-11-08 09:42:56 +01:00
Dedent parseDisguise() method for-loop
This commit is contained in:
parent
bb0ac727bf
commit
1207d70d6e
@ -279,8 +279,14 @@ public abstract class BaseDisguiseCommand implements CommandExecutor {
|
|||||||
if (!method.getName().startsWith("get") && method.getName().equalsIgnoreCase(methodName)
|
if (!method.getName().startsWith("get") && method.getName().equalsIgnoreCase(methodName)
|
||||||
&& method.getAnnotation(Deprecated.class) == null && method.getParameterTypes().length == 1) {
|
&& method.getAnnotation(Deprecated.class) == null && method.getParameterTypes().length == 1) {
|
||||||
methodToUse = method;
|
methodToUse = method;
|
||||||
methodName = method.getName();
|
break;
|
||||||
Class<?>[] types = method.getParameterTypes();
|
}
|
||||||
|
}
|
||||||
|
if (methodToUse == null) {
|
||||||
|
throw new Exception(ChatColor.RED + "Cannot find the option " + methodName);
|
||||||
|
}
|
||||||
|
methodName = methodToUse.getName();
|
||||||
|
Class<?>[] types = methodToUse.getParameterTypes();
|
||||||
if (types.length == 1) {
|
if (types.length == 1) {
|
||||||
Class param = types[0];
|
Class param = types[0];
|
||||||
// Parse to number
|
// 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())) {
|
if (!usedOptions.contains(methodName.toLowerCase())) {
|
||||||
usedOptions.add(methodName.toLowerCase());
|
usedOptions.add(methodName.toLowerCase());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user