mirror of
https://github.com/aikar/commands.git
synced 2026-05-31 06:11:55 +00:00
Do not double add BaseCommands in RootCommand children #439
Also register command aliases more completely
This commit is contained in:
@@ -263,6 +263,7 @@ public abstract class BaseCommand {
|
||||
Collections.addAll(cmdList, cmdAliases);
|
||||
cmdList.remove(cmd);
|
||||
for (String cmdAlias : cmdList) {
|
||||
registerSubclasses(cmdAlias);
|
||||
register(cmdAlias, this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,9 @@ public interface RootCommand {
|
||||
subCommands.put(e.getKey(), e.getValue());
|
||||
});
|
||||
|
||||
children.add(command);
|
||||
if (!children.contains(command)) {
|
||||
children.add(command);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user