throw new CommandNotFoundException(Lang.NOT_FOUND);
@Override public void execute(MinecraftServer minecraftServer, ICommandSender sender, String[] arguments) throws CommandException { if (arguments.length < 1) { arguments = new String[] { "help" }; } ISubCommand command = commands.get(arguments[0]); if (command != null) { if (canUseCommand(sender, command.getPermissionLevel(), command.getCommandName())) { command.handleCommand(minecraftServer, sender, arguments); return; } throw new CommandException("commands.generic.permission"); } throw new CommandNotFoundException("chat.cofh.command.notFound"); }
String commandName = args[1]; if (!CommandHandler.getCommandExists(commandName)) { throw new CommandNotFoundException("chat.cofh.command.notFound");
@Override public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException { if (args.length < 1) { args = new String[]{"help"}; } ISubCommand command = commands.get(args[0]); if (command != null) { if (command.isVisible(sender) && (sender.canUseCommand(command.getPermissionLevel(), getName() + " " + command.getCommandName()) || (sender instanceof EntityPlayerMP && command.getPermissionLevel() <= 0))) { command.handleCommand(sender, Arrays.copyOfRange(args, 1, args.length)); return; } throw new CommandException(Lang.NO_PERMISSION); } throw new CommandNotFoundException(Lang.NOT_FOUND); } }
String commandName = args[1]; if (!CommandHandler.getCommandExists(commandName)) { throw new CommandNotFoundException("chat.cofh.command.notFound");