@Override
    public boolean onCommand(CommandSender sender, org.bukkit.command.Command cmd, String label, String[] args) {
        for (CommandGroup command : commands) {
            if (command.getName().equalsIgnoreCase(cmd.getName())) {
                String subCommand = args.length > 0 ? args[0] : "";
                if (command.hasChildCommand(subCommand)) {
                    if (subCommand.equals("")) {
                        command.execute(subCommand, sender, args);
                    } else {
                        String[] newArgs;
                        if (args.length == 1) {
                            newArgs = new String[0];
                        } else {
                            newArgs = new String[args.length - 1];
                            System.arraycopy(args, 1, newArgs, 0, args.length - 1);
                        }
                        command.execute(subCommand, sender, newArgs);
                    }
                } else {
                    plugin.getMessenger().sendMessage(sender, DefaultMessage.COMMAND_INVALID, "\"" + subCommand + "\"", "\"" + command.getName() + "\"");
                }
                return true;
            }
        }
        return false;
    }