mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-12-24 18:18:58 +01:00
Hide nameplates for empty hologram names
This commit is contained in:
parent
3c2d0625b4
commit
59d4f7033c
@ -164,8 +164,10 @@ public class HologramTrait extends Trait {
|
|||||||
String text = lines.get(i);
|
String text = lines.get(i);
|
||||||
if (text != null && !text.isEmpty()) {
|
if (text != null && !text.isEmpty()) {
|
||||||
hologramNPC.setName(Placeholders.replace(text, null, npc));
|
hologramNPC.setName(Placeholders.replace(text, null, npc));
|
||||||
|
hologramNPC.data().set(NPC.NAMEPLATE_VISIBLE_METADATA, true);
|
||||||
} else {
|
} else {
|
||||||
hologramNPC.setName("");
|
hologramNPC.setName("");
|
||||||
|
hologramNPC.data().set(NPC.NAMEPLATE_VISIBLE_METADATA, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user