示例#1
0
 public List<String> getBannedPlayers() throws APIException {
   List<String> a = new ArrayList<String>();
   for (OfflinePlayer p : Server.getBannedPlayers()) {
     a.add(p.getName());
   }
   return a;
 }
示例#2
0
  public List<OfflinePlayer> opList() {
    List<OfflinePlayer> ops = new ArrayList<OfflinePlayer>();

    for (OfflinePlayer p : Bukkit.getOfflinePlayers()) {
      if (p.isOp()) {
        ops.add(p);
      }
    }

    return ops;
  }
示例#3
0
  public List<OfflinePlayer> getOfflinePlayers() {
    List<OfflinePlayer> o = new ArrayList<OfflinePlayer>();
    List<String> online = getPlayerNames();

    for (OfflinePlayer p : Server.getOfflinePlayers()) {
      if (!online.contains(p.getName())) {
        o.add(p);
      }
    }

    return o;
  }
示例#4
0
  public List<String> getOfflinePlayerNames() {
    List<String> names = new ArrayList<String>();
    List<String> online = getPlayerNames();

    for (OfflinePlayer p : Server.getOfflinePlayers()) {
      if (!online.contains(p.getName())) {
        names.add(p.getName());
      }
    }

    return names;
  }
示例#5
0
  public boolean deop(String playerName) {
    try {
      OfflinePlayer p = Bukkit.getOfflinePlayer(playerName);

      if (p.isOnline()) {
        p.getPlayer().sendMessage("You are no longer OP");
      }

      p.setOp(false);
      return true;
    } catch (Exception e) {
      return false;
    }
  }