diff options
author | Erik Broes <erikbroes@grum.nl> | 2011-02-05 22:13:53 +0100 |
---|---|---|
committer | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-02-07 01:51:05 +0000 |
commit | 550ad6f9d117f24b6d6123f64ad8ab42409ee4f3 (patch) | |
tree | d19042b09ccb18bb74aafac6a8e52d33f273d85e /src/main/java | |
parent | b229931ce6bd76b19e8e45ce1b4f7665f612eb51 (diff) | |
download | craftbukkit-550ad6f9d117f24b6d6123f64ad8ab42409ee4f3.tar craftbukkit-550ad6f9d117f24b6d6123f64ad8ab42409ee4f3.tar.gz craftbukkit-550ad6f9d117f24b6d6123f64ad8ab42409ee4f3.tar.lz craftbukkit-550ad6f9d117f24b6d6123f64ad8ab42409ee4f3.tar.xz craftbukkit-550ad6f9d117f24b6d6123f64ad8ab42409ee4f3.zip |
Proper 'otherworld' chunkloading
Diffstat (limited to 'src/main/java')
-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); + } } } |