public boolean onCommand(CommandSender sender, org.bukkit.command.Command command, String label, String[] args)
    {
        SubCommand subCommand;
        if (args.length > 0)
        {
            subCommand = this.getCommand(args[0]);
        }
        else
        {
            subCommand = this.getCommandByName(this.defaultCommand);
            args = new String[] {subCommand.getName()};
        }

        if (subCommand != null)
        {
            Permission permission = subCommand.getPermission();
            if (permission != null && !sender.hasPermission(permission))
            {
                sender.sendMessage(_("command_permdenied"));
            }
            else
            {
                try
                {
                    CommandArgs commandArgs = new CommandArgs(this, label, subCommand, args);
                    if (!subCommand.execute(sender, commandArgs))
                    {
                        sender.sendMessage("/" + label + " " + commandArgs.getLabel() + " " + subCommand.getUsage());
                    }
                    return true;
                }
                catch (CommandException e)
                {
                    sender.sendMessage(e.getLocalizedMessage());
                }
                catch (Throwable t)
                {
                    sender.sendMessage(_("command_internalerror"));
                    t.printStackTrace(System.err);
                }
            }
        }
        else
        {
            sender.sendMessage(_("command_notfound"));
        }

        return true;
    }