diff options
Diffstat (limited to 'src/main/java/net/minecraft/server/Entity.java')
-rw-r--r-- | src/main/java/net/minecraft/server/Entity.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java index d11786c9..0937d2eb 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -980,7 +980,17 @@ public abstract class Entity { // CraftBukkit end // CraftBukkit Start - reset world - org.bukkit.World world = Bukkit.getServer().getWorld(nbttagcompound.getString("World")); + org.bukkit.World world = null; + if (this instanceof EntityPlayer) { + EntityPlayer entityPlayer = (EntityPlayer) this; + String worldName = nbttagcompound.getString("World"); + if (worldName == "") { + world = (org.bukkit.World) ((CraftServer) Bukkit.getServer()).getServer().a(entityPlayer.dimension); + } else { + world = Bukkit.getServer().getWorld(worldName); + } + } + a(world == null ? null : ((CraftWorld) world).getHandle()); // CraftBukkit End } |