Skip to content

Commit

Permalink
Move hologram meta check to abstract NPC
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Nov 15, 2023
1 parent 82304b1 commit c042566
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/main/java/net/citizensnpcs/api/npc/AbstractNPC.java
Expand Up @@ -384,11 +384,10 @@ public void removeTrait(Class<? extends Trait> traitClass) {

@Override
public boolean requiresNameHologram() {
return getEntityType() != EntityType.ARMOR_STAND && !getEntityType().name().equals("TEXT_DISPLAY")
&& (name.length() > 16 && getEntityType() == EntityType.PLAYER
|| data().get(NPC.Metadata.ALWAYS_USE_NAME_HOLOGRAM, false)
|| coloredNameStringCache != null && coloredNameStringCache.contains("§x")
|| !Placeholders.replaceName(name, null, this).equals(name));
return !data().has(NPC.Metadata.HOLOGRAM_FOR) && ((name.length() > 16 && getEntityType() == EntityType.PLAYER)
|| data().get(NPC.Metadata.ALWAYS_USE_NAME_HOLOGRAM, false)
|| coloredNameStringCache != null && coloredNameStringCache.contains("§x")
|| !Placeholders.replaceName(name, null, this).equals(name));
}

@Override
Expand Down

0 comments on commit c042566

Please sign in to comment.