Include inherited methods on register (for precommand/help etc)

This commit is contained in:
Aikar
2017-11-22 22:07:16 -05:00
parent 55d238614f
commit d560beeeab
3 changed files with 4 additions and 10 deletions
@@ -120,7 +120,7 @@ public abstract class BaseCommand {
boolean foundDefault = false;
boolean foundUnknown = false;
for (Method method : self.getDeclaredMethods()) {
for (Method method : self.getMethods()) {
method.setAccessible(true);
String sublist = null;
String sub = getSubcommandValue(method);
@@ -166,7 +166,7 @@ public abstract class BaseCommand {
ACFUtil.sneaky(new IllegalStateException("Multiple @PreCommand commands, duplicate on " + method.getDeclaringClass().getName() + "#" + method.getName()));
}
}
if (sublist != null) {
if (Objects.equals(method.getDeclaringClass(), this.getClass()) && sublist != null) {
registerSubcommand(method, sublist);
}
}