mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-12-24 10:11:24 +01:00
Don't teleport if despawned
This commit is contained in:
parent
0036c9d6a2
commit
57373a68a3
@ -326,6 +326,8 @@ public class CitizensNPC extends AbstractNPC {
|
||||
@Override
|
||||
public void teleport(Location location, TeleportCause reason) {
|
||||
super.teleport(location, reason);
|
||||
if (!isSpawned())
|
||||
return;
|
||||
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