Beispiel #1
0
  @Override
  public Result onCommand(LWC lwc, CommandSender sender, String command, String[] args) {
    if (!StringUtils.hasFlag(command, "a") && !StringUtils.hasFlag(command, "admin")) {
      return DEFAULT;
    }

    if (!args[0].equals("cmd")) {
      return DEFAULT;
    }

    sender.sendMessage(Colors.Green + "Flushing Update Thread..");
    lwc.getUpdateThread().flush();
    sender.sendMessage(Colors.Green + "Done.");
    return CANCEL;
  }
Beispiel #2
0
  @Override
  public Result onCommand(LWC lwc, CommandSender sender, String command, String[] args) {
    if (!StringUtils.hasFlag(command, "a") && !StringUtils.hasFlag(command, "admin")) {
      return DEFAULT;
    }

    if (args.length == 0) {
      if (lwc.isAdmin(sender)) {
        lwc.sendLocale(sender, "help.admin");
      }

      return CANCEL;
    } else if (args.length > 0) {
      // check for permissions
      if (!lwc.hasAdminPermission(sender, "lwc.admin." + args[0])) {
        return CANCEL;
      }
    }

    return DEFAULT;
  }