Simplify OfflinePlayer.getPlayer() logic.

This commit is contained in:
md_5 2015-07-13 18:54:08 +10:00
parent 1f73bbb56a
commit 65cd4d79fd

View File

@ -144,14 +144,7 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa
}
public Player getPlayer() {
for (Object obj : server.getHandle().players) {
EntityPlayer player = (EntityPlayer) obj;
if (player.getUniqueID().equals(getUniqueId())) {
return (player.playerConnection != null) ? player.playerConnection.getPlayer() : null;
}
}
return null;
return server.getPlayer(getUniqueId());
}
@Override