mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-02 21:17:00 +01:00
Possible fix for some chunk loading issues experienced when teleporting. Thanks akrieger!
This commit is contained in:
parent
7499e2e0df
commit
891dfbcef8
1 changed files with 3 additions and 2 deletions
|
@ -170,11 +170,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||||
WorldServer newWorld = ((CraftWorld)location.getWorld()).getHandle();
|
WorldServer newWorld = ((CraftWorld)location.getWorld()).getHandle();
|
||||||
ServerConfigurationManager manager = server.getHandle();
|
ServerConfigurationManager manager = server.getHandle();
|
||||||
EntityPlayer entity = getHandle();
|
EntityPlayer entity = getHandle();
|
||||||
|
boolean successfulTeleport = entity.netServerHandler.teleport(location);
|
||||||
|
|
||||||
if (oldWorld != newWorld) {
|
if (oldWorld != newWorld && successfulTeleport) {
|
||||||
this.entity = manager.a(entity, newWorld.dimension, false);
|
this.entity = manager.a(entity, newWorld.dimension, false);
|
||||||
}
|
}
|
||||||
return entity.netServerHandler.teleport(location);
|
return successfulTeleport;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSneaking(boolean sneak) {
|
public void setSneaking(boolean sneak) {
|
||||||
|
|
Loading…
Reference in a new issue