Simplify OfflinePlayer.getPlayer() logic.

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot 2015-07-13 18:54:08 +10:00
parent f0c27fe66c
commit e19d7d24a2

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