From 7a71347cdfec29433cd7c6d21f9a2450af9e52e7 Mon Sep 17 00:00:00 2001 From: Dinnerbone Date: Mon, 7 Feb 2011 01:10:55 +0000 Subject: [PATCH] Fixed logging into the correct world --- src/main/java/net/minecraft/server/Entity.java | 15 +++++++++++++++ .../server/ServerConfigurationManager.java | 6 +++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java index 5a58da0ecf..fa74527a1e 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -809,6 +809,7 @@ public abstract class Entity { nbttagcompound.a("Fire", (short) this.fireTicks); nbttagcompound.a("Air", (short) this.airTicks); nbttagcompound.a("OnGround", this.onGround); + nbttagcompound.a("World", world.w); // Craftbukkit this.a(nbttagcompound); } @@ -830,6 +831,20 @@ public abstract class Entity { this.fireTicks = nbttagcompound.c("Fire"); this.airTicks = nbttagcompound.c("Air"); this.onGround = nbttagcompound.l("OnGround"); + + // Craftbukkit start + if (nbttagcompound.a("World")) { + String worldName = nbttagcompound.h("World"); + + for (WorldServer world : ((WorldServer)this.world).getServer().getServer().worlds) { + if (world.w.equals(worldName)) { + this.world = world; + break; + } + } + } + // Craftbukkit end + this.a(this.locX, this.locY, this.locZ); this.b(nbttagcompound); } diff --git a/src/main/java/net/minecraft/server/ServerConfigurationManager.java b/src/main/java/net/minecraft/server/ServerConfigurationManager.java index 4e725672ed..70e3ea397e 100644 --- a/src/main/java/net/minecraft/server/ServerConfigurationManager.java +++ b/src/main/java/net/minecraft/server/ServerConfigurationManager.java @@ -65,7 +65,11 @@ public class ServerConfigurationManager { } public void a(WorldServer worldserver) { - this.l = new PlayerNBTManager(new File(worldserver.t, "players")); + // Craftbukkit start + if (this.l == null) { + this.l = new PlayerNBTManager(new File(worldserver.t, "players")); + } + // Craftbukkit end } public int a() {