String name = online[i].getDisplayName();
long ping = (long) (1000.0F * pingComponent.getPing());
temp.add(name);
Long oldPing = players.put(name, ping);
if (oldPing == null || !oldPing.equals(ping)) {
player.getNetwork().callProtocolEvent(new ListPingEvent(name, ping, true));
}
}
}
Iterator<String> itr = players.keySet().iterator();
while (itr.hasNext()) {
String name = itr.next();
if (!temp.contains(name)) {
player.getNetwork().callProtocolEvent(new ListPingEvent(name, 0L, false));
itr.remove();
}
}
}