From 87d721733f1575b7fc4721000b6dd10440cd34ae Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Sat, 5 Feb 2011 22:13:53 +0100 Subject: [PATCH] Proper 'otherworld' chunkloading By: Erik Broes --- .../java/org/bukkit/craftbukkit/entity/CraftPlayer.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index 20cc0010d3..1465e94296 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/paper-server/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); + } } }