Exemplo n.º 1
0
 @Override
 public Set<OfflinePlayer> getOperators() {
   Set<OfflinePlayer> offlinePlayers = new HashSet<>();
   for (UUID uuid : opsList.getUUIDs()) {
     offlinePlayers.add(getOfflinePlayer(uuid));
   }
   return offlinePlayers;
 }
Exemplo n.º 2
0
 @Override
 public Set<String> getIPBans() {
   Set<String> result = new HashSet<>();
   for (BanEntry entry : ipBans.getBanEntries()) {
     result.add(entry.getTarget());
   }
   return result;
 }
Exemplo n.º 3
0
 @Override
 public Set<OfflinePlayer> getBannedPlayers() {
   Set<OfflinePlayer> bannedPlayers = new HashSet<>();
   for (BanEntry entry : nameBans.getBanEntries()) {
     bannedPlayers.add(getOfflinePlayer(entry.getTarget()));
   }
   return bannedPlayers;
 }
Exemplo n.º 4
0
 @Override
 public Set<OfflinePlayer> getWhitelistedPlayers() {
   Set<OfflinePlayer> players = new HashSet<>();
   for (UUID uuid : whitelist.getUUIDs()) {
     players.add(getOfflinePlayer(uuid));
   }
   return players;
 }
Exemplo n.º 5
0
  @Override
  public OfflinePlayer[] getOfflinePlayers() {
    Set<OfflinePlayer> result = new HashSet<>();
    Set<UUID> uuids = new HashSet<>();

    // add the currently online players
    for (World world : getWorlds()) {
      for (Player player : world.getPlayers()) {
        result.add(player);
        uuids.add(player.getUniqueId());
      }
    }

    // add all offline players that aren't already online
    for (OfflinePlayer offline : getPlayerDataService().getOfflinePlayers()) {
      if (!uuids.contains(offline.getUniqueId())) {
        result.add(offline);
        uuids.add(offline.getUniqueId());
      }
    }

    return result.toArray(new OfflinePlayer[result.size()]);
  }