Update custom name status immediately on spawn

This commit is contained in:
fullwall 2020-07-11 00:38:27 +08:00
parent 82c33ebfe3
commit f3986ec9cc
1 changed files with 1 additions and 6 deletions

View File

@ -268,12 +268,6 @@ public class CitizensNPC extends AbstractNPC {
NMS.setHeadYaw(getEntity(), at.getYaw());
NMS.setBodyYaw(getEntity(), at.getYaw());
String nameplateVisible = data().<Object> get(NPC.NAMEPLATE_VISIBLE_METADATA, true).toString();
if (requiresNameHologram()) {
nameplateVisible = "false";
}
getEntity().setCustomNameVisible(Boolean.parseBoolean(nameplateVisible));
// Set the spawned state
getTrait(CurrentLocation.class).setLocation(at);
getTrait(Spawned.class).setSpawned(true);
@ -323,6 +317,7 @@ public class CitizensNPC extends AbstractNPC {
}
updateFlyableState();
updateCustomName();
Messaging.debug("Spawned", getId(), "SpawnReason." + reason);
return true;