diff --git a/paper-server/src/org/bukkit/craftbukkit/CraftPlayer.java b/paper-server/src/org/bukkit/craftbukkit/CraftPlayer.java index 0b86306d3d..643dea160f 100644 --- a/paper-server/src/org/bukkit/craftbukkit/CraftPlayer.java +++ b/paper-server/src/org/bukkit/craftbukkit/CraftPlayer.java @@ -1,15 +1,15 @@ package org.bukkit.craftbukkit; -import net.minecraft.server.fi; +import net.minecraft.server.EntityPlayerMP; import org.bukkit.Player; public class CraftPlayer implements Player { - private fi player; + private EntityPlayerMP player; private final String name; private final CraftServer server; - public CraftPlayer(CraftServer serv, fi handle) { + public CraftPlayer(CraftServer serv, EntityPlayerMP handle) { player = handle; name = player.aw; server = serv; diff --git a/paper-server/src/org/bukkit/craftbukkit/CraftServer.java b/paper-server/src/org/bukkit/craftbukkit/CraftServer.java index 770a39d579..c6aaec7e7a 100644 --- a/paper-server/src/org/bukkit/craftbukkit/CraftServer.java +++ b/paper-server/src/org/bukkit/craftbukkit/CraftServer.java @@ -8,6 +8,7 @@ import java.util.logging.Level; import java.util.logging.Logger; import org.bukkit.*; import net.minecraft.server.*; +import org.bukkit.plugin.Plugin; import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.SimplePluginManager; import org.bukkit.plugin.java.JavaPluginLoader; @@ -19,7 +20,7 @@ public final class CraftServer implements Server { private final PluginManager pluginManager = new SimplePluginManager(this); protected final MinecraftServer console; - protected final hl server; + protected final ServerConfigurationManager server; public CraftServer(MinecraftServer instance, String ver) { serverVersion = ver; @@ -50,7 +51,7 @@ public final class CraftServer implements Server { } public Player[] getOnlinePlayers() { - List online = server.b; + List online = server.b; Player[] players = new Player[online.size()]; for (int i = 0; i < players.length; i++) { @@ -67,6 +68,17 @@ public final class CraftServer implements Server { return players; } + public Player getPlayer(EntityPlayerMP entity) { + Player result = playerCache.get(entity.aw); + + if (result == null) { + result = new CraftPlayer(this, entity); + playerCache.put(entity.aw, result); + } + + return result; + } + public PluginManager getPluginManager() { return pluginManager; }