Skip to content

Commit 7f48acb

Browse files
committed
Fix Player.teleportTo not working cross-world
1 parent 7b47c94 commit 7f48acb

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/Player.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,20 @@ public void teleportTo(double x, double y, double z, float rotation, float pitch
712712
this.getEntity().a.a(x, y, z, rotation, pitch);
713713
}
714714

715+
@Override
716+
public void teleportTo(BaseEntity entity) {
717+
this.teleportTo(entity.getLocation());
718+
}
719+
720+
@Override
721+
public void teleportTo(Location loc) {
722+
if (!loc.getWorld().equals(this.getWorld())) {
723+
this.switchWorlds(loc.getWorld());
724+
}
725+
726+
super.teleportTo(loc);
727+
}
728+
715729
/**
716730
* Returns true if the player is muted.
717731
*

0 commit comments

Comments
 (0)