diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index 20cc0010..1465e942 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -113,10 +113,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void teleportTo(Location location) { - if (location.getWorld() != getWorld()) { + boolean worldChange = location.getWorld() != getWorld(); + if (worldChange) { + // Unload player from current chunks server.getServer().f.d.b(entity); } entity.world = ((CraftWorld)location.getWorld()).getHandle(); entity.b(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); + if (worldChange) { + // Forceload the chunks around player + server.getServer().f.d.a(entity); + } } } |