Example #1
0
 @Override
 public Set<OfflinePlayer> getOperators() {
   Set<OfflinePlayer> offlinePlayers = new HashSet<>();
   for (UUID uuid : opsList.getUUIDs()) {
     offlinePlayers.add(getOfflinePlayer(uuid));
   }
   return offlinePlayers;
 }
Example #2
0
 @Override
 public Set<OfflinePlayer> getBannedPlayers() {
   Set<OfflinePlayer> bannedPlayers = new HashSet<>();
   for (BanEntry entry : nameBans.getBanEntries()) {
     bannedPlayers.add(getOfflinePlayer(entry.getTarget()));
   }
   return bannedPlayers;
 }
Example #3
0
 @Override
 public Set<String> getIPBans() {
   Set<String> result = new HashSet<>();
   for (BanEntry entry : ipBans.getBanEntries()) {
     result.add(entry.getTarget());
   }
   return result;
 }
Example #4
0
 @Override
 public Set<OfflinePlayer> getWhitelistedPlayers() {
   Set<OfflinePlayer> players = new HashSet<>();
   for (UUID uuid : whitelist.getUUIDs()) {
     players.add(getOfflinePlayer(uuid));
   }
   return players;
 }
Example #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()]);
  }
Example #6
0
 @Override
 public void addPermission(Permission prmsn) {
   permissions.add(prmsn);
 }