From 891dfbcef8c98faec837fc7f3fa31eac5505b6f9 Mon Sep 17 00:00:00 2001 From: EvilSeph Date: Sun, 5 Jun 2011 12:38:56 -0400 Subject: [PATCH] Possible fix for some chunk loading issues experienced when teleporting. Thanks akrieger! --- src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index eded0b3130..4d6fe88c55 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -170,11 +170,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { WorldServer newWorld = ((CraftWorld)location.getWorld()).getHandle(); ServerConfigurationManager manager = server.getHandle(); EntityPlayer entity = getHandle(); + boolean successfulTeleport = entity.netServerHandler.teleport(location); - if (oldWorld != newWorld) { + if (oldWorld != newWorld && successfulTeleport) { this.entity = manager.a(entity, newWorld.dimension, false); } - return entity.netServerHandler.teleport(location); + return successfulTeleport; } public void setSneaking(boolean sneak) {