diff options
author | zreed <zach@digitalforgemc.com> | 2014-12-05 01:44:14 -0500 |
---|---|---|
committer | zreed <zach@digitalforgemc.com> | 2014-12-05 02:03:49 -0500 |
commit | 9e04f2f765194c087b52c3707a482ed9d5e56c8d (patch) | |
tree | 654764773a74eea912d76698ca8df82fcff49a22 /src/main | |
parent | e2c4f20ed1430a6fde29ba1c82d4e886db9467dc (diff) | |
download | craftbukkit-9e04f2f765194c087b52c3707a482ed9d5e56c8d.tar craftbukkit-9e04f2f765194c087b52c3707a482ed9d5e56c8d.tar.gz craftbukkit-9e04f2f765194c087b52c3707a482ed9d5e56c8d.tar.lz craftbukkit-9e04f2f765194c087b52c3707a482ed9d5e56c8d.tar.xz craftbukkit-9e04f2f765194c087b52c3707a482ed9d5e56c8d.zip |
Use PlayerList's UUID->EntityPlayer map in CraftServer.getPlayer(UUID)
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/CraftServer.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index 64b2961b..075a7fd4 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -415,13 +415,12 @@ public final class CraftServer implements Server { return null; } - // TODO: In 1.8+ this should use the server's UUID->EntityPlayer map @Override public Player getPlayer(UUID id) { - for (Player player : getOnlinePlayers()) { - if (player.getUniqueId().equals(id)) { - return player; - } + EntityPlayer player = playerList.a(id); + + if (player != null) { + return player.getBukkitEntity(); } return null; |