From 65cd4d79fd342efc32717baa55d0a6daaf85a9fd Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 13 Jul 2015 18:54:08 +1000 Subject: [PATCH] Simplify OfflinePlayer.getPlayer() logic. --- .../java/org/bukkit/craftbukkit/CraftOfflinePlayer.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java index 8be0698476..45217866bb 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java @@ -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