Update tablist after teleport

This commit is contained in:
fullwall 2020-05-12 22:13:22 +08:00
parent feb6bc2851
commit 0498353751
2 changed files with 9 additions and 2 deletions

View File

@ -639,6 +639,13 @@ public class EventListen implements Listener {
}
continue;
}
if (npc.isSpawned()) {
ids.remove(i--);
if (Messaging.isDebugging()) {
Messaging.debug("NPC", npc.getId(), "already spawned");
}
continue;
}
boolean success = spawn(npc);
if (!success) {
if (Messaging.isDebugging()) {

View File

@ -318,8 +318,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) {
NMS.setHeadYaw(getEntity(), location.getYaw());
if (getEntity() instanceof SkinnableEntity) {
((SkinnableEntity) getEntity()).getSkinTracker().updateNearbyViewers(48);
}
}