@Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { Player player = null; if (sender instanceof Player) { player = (Player) sender; } try { return cmds.dispatch(player, command.getName(), args); } catch (SMSException e) { MiscUtil.errorMessage(player, e.getMessage()); return true; } }
private void registerCommands() { cmds.registerCommand(new AddItemCommand()); cmds.registerCommand(new AddMacroCommand()); cmds.registerCommand(new AddViewCommand()); cmds.registerCommand(new CreateMenuCommand()); cmds.registerCommand(new DebugCommand()); cmds.registerCommand(new DefaultCmdCommand()); cmds.registerCommand(new DeleteMenuCommand()); cmds.registerCommand(new GetConfigCommand()); cmds.registerCommand(new GiveMapCommand()); cmds.registerCommand(new ItemUseCommand()); cmds.registerCommand(new ListMacroCommand()); cmds.registerCommand(new ListMenusCommand()); cmds.registerCommand(new MenuTitleCommand()); cmds.registerCommand(new PageCommand()); cmds.registerCommand(new ReloadCommand()); cmds.registerCommand(new RemoveItemCommand()); cmds.registerCommand(new RemoveMacroCommand()); cmds.registerCommand(new RemoveViewCommand()); cmds.registerCommand(new SaveCommand()); cmds.registerCommand(new SetConfigCommand()); cmds.registerCommand(new ShowMenuCommand()); cmds.registerCommand(new SortMenuCommand()); cmds.registerCommand(new VarCommand()); cmds.registerCommand(new ViewCommand()); }