mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-27 21:19:00 +01:00
Proper 'otherworld' chunkloading
This commit is contained in:
parent
b229931ce6
commit
550ad6f9d1
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user