Archiviert
13
0

Proper 'otherworld' chunkloading

Dieser Commit ist enthalten in:
Erik Broes 2011-02-05 22:13:53 +01:00 committet von Dinnerbone
Ursprung b229931ce6
Commit 550ad6f9d1

Datei anzeigen

@ -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);
}
}
}