mirror of
https://github.com/aikar/commands.git
synced 2026-06-30 10:18:29 +00:00
Include inherited methods on register (for precommand/help etc)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user