Fix duplication of name hologram

This commit is contained in:
fullwall 2020-07-09 23:37:45 +08:00
parent cb676c4b19
commit ea20cdb21e
2 changed files with 7 additions and 4 deletions

View File

@ -268,10 +268,8 @@ public class CitizensNPC extends AbstractNPC {
NMS.setHeadYaw(getEntity(), at.getYaw());
NMS.setBodyYaw(getEntity(), at.getYaw());
if (requiresNameHologram() && !hasTrait(HologramTrait.class)) {
addTrait(HologramTrait.class);
}
String nameplateVisible = data().<Object> get(NPC.NAMEPLATE_VISIBLE_METADATA, true).toString();
String nameplateVisible = data().<Object> get(NPC.NAMEPLATE_VISIBLE_METADATA, !requiresNameHologram())
.toString();
getEntity().setCustomNameVisible(Boolean.parseBoolean(nameplateVisible));
// Set the spawned state
@ -318,6 +316,10 @@ public class CitizensNPC extends AbstractNPC {
PlayerUpdateTask.registerPlayer(getEntity());
}
if (requiresNameHologram() && !hasTrait(HologramTrait.class)) {
addTrait(HologramTrait.class);
}
updateFlyableState();
Messaging.debug("Spawned", getId(), "SpawnReason." + reason);

View File

@ -74,6 +74,7 @@ public class CommandTrait extends Trait {
economy.withdrawPlayer(player, cost);
}
} catch (NoClassDefFoundError e) {
Messaging.severe("Unable to find Vault when checking command cost - is it installed?");
}
}
return true;