mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-02-27 09:42:37 +01:00
teleport should check cross-world
This commit is contained in:
parent
f3986ec9cc
commit
c60e18bd87
@ -326,7 +326,8 @@ public class CitizensNPC extends AbstractNPC {
|
||||
@Override
|
||||
public void teleport(Location location, TeleportCause reason) {
|
||||
super.teleport(location, reason);
|
||||
if (isSpawned() && getEntity().getLocation(CACHE_LOCATION).distanceSquared(location) < 1) {
|
||||
Location npcLoc = getEntity().getLocation(CACHE_LOCATION);
|
||||
if (isSpawned() && npcLoc.getWorld() == location.getWorld() && npcLoc.distanceSquared(location) < 1) {
|
||||
NMS.setHeadYaw(getEntity(), location.getYaw());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user