diff --git a/paper-server/src/org/bukkit/craftbukkit/CraftEntity.java b/paper-server/src/org/bukkit/craftbukkit/CraftEntity.java index 71aa013c1b..2a2f2392e7 100644 --- a/paper-server/src/org/bukkit/craftbukkit/CraftEntity.java +++ b/paper-server/src/org/bukkit/craftbukkit/CraftEntity.java @@ -20,7 +20,7 @@ public class CraftEntity implements org.bukkit.Entity { } public World getWorld() { - return server.getWorld((WorldServer)entity.l); + return ((WorldServer)entity.l).getWorld(); } public void teleportTo(Location location) { diff --git a/paper-server/src/org/bukkit/craftbukkit/CraftServer.java b/paper-server/src/org/bukkit/craftbukkit/CraftServer.java index 34aca81e79..9060d062ad 100644 --- a/paper-server/src/org/bukkit/craftbukkit/CraftServer.java +++ b/paper-server/src/org/bukkit/craftbukkit/CraftServer.java @@ -19,7 +19,6 @@ public final class CraftServer implements Server { private final String serverName = "Craftbukkit"; private final String serverVersion; private final HashMap playerCache = new HashMap(); - private final HashMap worldCache = new HashMap(); private final PluginManager pluginManager = new SimplePluginManager(this); protected final MinecraftServer console; @@ -87,18 +86,7 @@ public final class CraftServer implements Server { } public World[] getWorlds() { - return new World[] { getWorld(console.e) }; - } - - public World getWorld(WorldServer world) { - World result = worldCache.get(world); - - if (result == null) { - result = new CraftWorld(world); - worldCache.put(world, result); - } - - return result; + return new World[] { console.e.getWorld() }; } public ServerConfigurationManager getHandle() { diff --git a/paper-server/src/org/bukkit/craftbukkit/CraftWorld.java b/paper-server/src/org/bukkit/craftbukkit/CraftWorld.java index f8f5a40e09..e3d691f846 100644 --- a/paper-server/src/org/bukkit/craftbukkit/CraftWorld.java +++ b/paper-server/src/org/bukkit/craftbukkit/CraftWorld.java @@ -13,7 +13,7 @@ public class CraftWorld implements World { private final Map blockCache = new HashMap(); private final WorldServer world; - protected CraftWorld(WorldServer world) { + public CraftWorld(WorldServer world) { this.world = world; }