Beispiel #1
0
  public List<Resident> getOnlineResidents(ResidentList residentList) {
    List<Resident> onlineResidents = new ArrayList<Resident>();
    for (Player player : plugin.getServer().getOnlinePlayers()) {
      for (Resident resident : residentList.getResidents()) {
        if (resident.getName().equalsIgnoreCase(player.getName())) onlineResidents.add(resident);
      }
    }

    return onlineResidents;
  }
Beispiel #2
0
 public static List<Player> getOnlinePlayers(ResidentList residents) {
   ArrayList<Player> players = new ArrayList<Player>();
   for (Player player : getOnlinePlayers())
     if (residents.hasResident(player.getName())) players.add(player);
   return players;
 }