class Root extends RootCommandNode<CommandSender> implements Mutable<CommandSender> {

    @Override
    public void addChild(CommandNode<CommandSender> command) {
        if (getChild(command.getName()) != null) {
            throw new IllegalArgumentException("Invalid command: '" + command.getName() + "', root already contains a child with the same name");
            
        }  else if (!(command instanceof LiteralCommandNode<?>)) {
            throw new IllegalArgumentException("Invalid command: '" + command.getName() + "', commands registered to root must be a literal");
        }
        
        var literal = (LiteralCommandNode<CommandSender>) command;
        
        var wrapper = map.register(literal);
        if (wrapper == null) {
            return;
        }
        
        super.addChild(Literal.alias(literal, prefix + ":" + literal.getName()));
        if (wrapper.getName().equals(wrapper.getLabel())) {
            super.addChild(literal);
        }
        
        if (literal instanceof Aliasable<?>) {
            for (var alias : new ArrayList<>((((Aliasable<CommandSender>) literal).aliases()))) {
                if (wrapper.getAliases().contains(alias.getName())) {
                    super.addChild(Literal.alias(literal, prefix + ":" + alias.getName()));
                    super.addChild(alias);
                }
            }
        }
    }

    public  Root(String prefix, PlatformMap map);

}