From 322330e9420c5fc91e014d4015a6280e35a06787 Mon Sep 17 00:00:00 2001 From: EvilSeph Date: Mon, 12 Dec 2011 02:51:12 -0500 Subject: [PATCH] Fixed players not receiving movement packets after trying to leave The End. Fixes BUKKIT-289. --- .../java/net/minecraft/server/NetServerHandler.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/minecraft/server/NetServerHandler.java b/src/main/java/net/minecraft/server/NetServerHandler.java index 3c4f9e81f8..ecf05ffe2b 100644 --- a/src/main/java/net/minecraft/server/NetServerHandler.java +++ b/src/main/java/net/minecraft/server/NetServerHandler.java @@ -9,6 +9,7 @@ import org.bukkit.ChatColor; import org.bukkit.craftbukkit.ChunkCompressionThread; import org.bukkit.Location; import org.bukkit.command.CommandException; +import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.craftbukkit.block.CraftBlock; import org.bukkit.craftbukkit.entity.CraftPlayer; import org.bukkit.craftbukkit.event.CraftEventFactory; @@ -924,7 +925,10 @@ public class NetServerHandler extends NetHandler implements ICommandListener { public void a(Packet9Respawn packet9respawn) { if (this.player.j) { - this.player = this.minecraftServer.serverConfigurationManager.moveToWorld(this.player, 0, true); + CraftWorld cworld = (CraftWorld) this.server.getWorlds().get(0); + ChunkCoordinates chunkcoordinates = cworld.getHandle().getSpawn(); + Location location = new Location(cworld, chunkcoordinates.x + 0.5, chunkcoordinates.y, chunkcoordinates.z + 0.5); + this.player = this.minecraftServer.serverConfigurationManager.moveToWorld(this.player, 0, true, location); } else { if (this.player.getHealth() > 0) { return; @@ -932,7 +936,10 @@ public class NetServerHandler extends NetHandler implements ICommandListener { this.player = this.minecraftServer.serverConfigurationManager.moveToWorld(this.player, 0, false); } - this.getPlayer().setHandle(this.player); // CraftBukkit + // CraftBukkit start + this.getPlayer().setHandle(this.player); + this.player.j = false; // allow the player to receive movement packets again. + // CraftBukkit end } public void a(Packet101CloseWindow packet101closewindow) {