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