Use PlayerList's UUID->EntityPlayer map in CraftServer.getPlayer(UUID)

By: zreed <zach@digitalforgemc.com>
This commit is contained in:
CraftBukkit/Spigot 2014-12-05 01:44:14 -05:00
parent 986787060f
commit 475a7cb579

View File

@ -415,13 +415,12 @@ public final class CraftServer implements Server {
return null; return null;
} }
// TODO: In 1.8+ this should use the server's UUID->EntityPlayer map
@Override @Override
public Player getPlayer(UUID id) { public Player getPlayer(UUID id) {
for (Player player : getOnlinePlayers()) { EntityPlayer player = playerList.a(id);
if (player.getUniqueId().equals(id)) {
return player; if (player != null) {
} return player.getBukkitEntity();
} }
return null; return null;