Fix every command being registered as default - Fixes #31

This commit is contained in:
Aikar
2017-05-15 22:35:48 -04:00
parent 39af64ad25
commit 276183ec04
@@ -68,12 +68,13 @@ public class RootCommand extends Command {
if (!this.defCommand.testPermission(sender)) {
return true;
}
this.defCommand.execute(sender, commandLabel, args);
return false;
}
void addChild(BaseCommand command) {
if (this.defCommand == null || command.subCommands.get("__default") != null) {
if (this.defCommand == null || !command.subCommands.get("__default").isEmpty()) {
this.defCommand = command;
this.setDescription(command.getDescription());
this.setUsage(command.getUsage());