Reorder npc update()

This commit is contained in:
fullwall 2023-02-08 21:06:10 +08:00
parent 8ba9d2ceb6
commit bbfbc767dc
2 changed files with 3 additions and 2 deletions

View File

@ -387,6 +387,7 @@ public class EventListen implements Listener {
@EventHandler(ignoreCancelled = true)
public void onPlayerChangedWorld(PlayerChangedWorldEvent event) {
skinUpdateTracker.removePlayer(event.getPlayer().getUniqueId());
if (CitizensAPI.getNPCRegistry().getNPC(event.getPlayer()) == null)
return;
NMS.removeFromServerPlayerList(event.getPlayer());

View File

@ -496,8 +496,6 @@ public class CitizensNPC extends AbstractNPC {
}
}
navigator.run();
boolean isLiving = getEntity() instanceof LivingEntity;
if (isUpdating(NPCUpdate.PACKET)) {
if (data().get(NPC.Metadata.KEEP_CHUNK_LOADED, Setting.KEEP_CHUNKS_LOADED.asBoolean())) {
@ -536,6 +534,8 @@ public class CitizensNPC extends AbstractNPC {
}
}
navigator.run();
updateCounter++;
} catch (Exception ex) {
Throwable error = Throwables.getRootCause(ex);