Hide nameplates for empty hologram names

This commit is contained in:
fullwall 2020-11-17 11:36:18 +08:00
parent 3c2d0625b4
commit 59d4f7033c
1 changed files with 2 additions and 0 deletions

View File

@ -164,8 +164,10 @@ public class HologramTrait extends Trait {
String text = lines.get(i);
if (text != null && !text.isEmpty()) {
hologramNPC.setName(Placeholders.replace(text, null, npc));
hologramNPC.data().set(NPC.NAMEPLATE_VISIBLE_METADATA, true);
} else {
hologramNPC.setName("");
hologramNPC.data().set(NPC.NAMEPLATE_VISIBLE_METADATA, false);
}
}
}