@Override
  public boolean execute(ArenaMaster am, CommandSender sender, String... args) {
    if (TFM_SuperadminList.isUserSuperadmin(sender)) {
      if (args.length < 1) {
        return false;
      }

      Arena arena;
      String point;
      if (args.length == 1) {
        if (am.getArenas().size() > 1) {
          Messenger.tell(sender, "There are multiple arenas.");
          return true;
        }
        arena = am.getArenas().get(0);
        point = args[0];
      } else {
        arena = am.getArenaWithName(args[0]);
        if (arena == null) {
          Messenger.tell(sender, "There is no arena named " + args[0]);
          return true;
        }
        point = args[1];
      }

      if (arena.getRegion().removeSpawn(point)) {
        Messenger.tell(
            sender, "Spawnpoint " + point + " removed for arena '" + arena.configName() + "'");
      } else {
        Messenger.tell(
            sender,
            "Could not find the spawnpoint "
                + point
                + " for the arena '"
                + arena.configName()
                + "'");
      }
    } else {
      sender.sendMessage(ChatColor.RED + "You do not have permission to use this command.");
    }
    return true;
  }
Esempio n. 2
0
    @Override
    public void upgrade(Arena arena, Player p) {
      if (perm == null) return;

      arena.addPermission(p, perm, value);
    }