Pass on usage/desc/aliases/etc to root command

This commit is contained in:
Aikar
2017-05-05 20:12:04 -04:00
parent 6022c66f78
commit 4e801ba012
@@ -24,7 +24,6 @@
package co.aikar.commands;
import org.apache.commons.lang.StringUtils;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
@@ -76,6 +75,11 @@ public class RootCommand extends Command {
void addChild(BaseCommand command) {
if (this.defCommand == null || command.subCommands.get("__default") != null) {
this.defCommand = command;
this.setDescription(command.getDescription());
this.setUsage(command.getUsage());
this.setAliases(command.getAliases());
this.setPermission(command.getPermission());
this.setPermissionMessage(command.getPermissionMessage());
}
command.subCommands.keySet().forEach(key -> {
if (key.equals(BaseCommand.DEFAULT) || key.equals(BaseCommand.UNKNOWN)) {