Simplify isOnline() logic.

This commit is contained in:
md_5 2015-07-13 18:30:25 +10:00
parent 55589cd363
commit 1f73bbb56a

View File

@ -105,13 +105,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
public boolean isOnline() {
for (Object obj : server.getHandle().players) {
EntityPlayer player = (EntityPlayer) obj;
if (player.getName().equalsIgnoreCase(getName())) {
return true;
}
}
return false;
return server.getPlayer(getUniqueId()) != null;
}
public InetSocketAddress getAddress() {