Пример #1
0
  static {
    modCommands.add(new CommandReload());
    modCommands.add(new CommandWebHook());
    modCommands.add(new CommandToken());
    modCommands.add(new CommandPort());
    modCommands.add(new CommandFormat());
    modCommands.add(new CommandOP());

    for (CommandBase commandBase : modCommands) {
      commands.add(commandBase.getCommandName());
    }
  }
Пример #2
0
  @Override
  public void execute(MinecraftServer server, ICommandSender commandSender, String[] args) {
    if (args.length >= 1) {
      for (CommandBase command : modCommands) {
        if (command.getCommandName().equalsIgnoreCase(args[0])
            && command.checkPermission(server, commandSender)) {
          try {
            command.execute(server, commandSender, args);
          } catch (CommandException e) {

          }
        }
      }
    } else {
      if (commandSender instanceof EntityPlayerMP) {
        commandSender.addChatMessage(new TextComponentString(Messages.Commands.BASE_COMMAND_USAGE));
      }
      LogHelper.info(Messages.Commands.BASE_COMMAND_USAGE);
    }
  }