From 4d54dd851288bde605ed87868e62f3263f7065c6 Mon Sep 17 00:00:00 2001 From: D3v1s0m Date: Tue, 11 Jun 2024 21:31:00 +0530 Subject: [PATCH] %blank% for empty hologram line --- .../java/lol/pyr/znpcsplus/hologram/HologramText.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugin/src/main/java/lol/pyr/znpcsplus/hologram/HologramText.java b/plugin/src/main/java/lol/pyr/znpcsplus/hologram/HologramText.java index 2c66aef..47e5e91 100644 --- a/plugin/src/main/java/lol/pyr/znpcsplus/hologram/HologramText.java +++ b/plugin/src/main/java/lol/pyr/znpcsplus/hologram/HologramText.java @@ -6,15 +6,25 @@ import lol.pyr.znpcsplus.entity.EntityPropertyRegistryImpl; import lol.pyr.znpcsplus.packets.PacketFactory; import lol.pyr.znpcsplus.util.NpcLocation; import net.kyori.adventure.text.Component; +import org.bukkit.entity.Player; public class HologramText extends HologramLine { + private static final Component BLANK = Component.text("%blank%"); + public HologramText(EntityPropertyRegistryImpl propertyRegistry, PacketFactory packetFactory, NpcLocation location, Component text) { super(text, packetFactory, EntityTypes.ARMOR_STAND, location); addProperty(propertyRegistry.getByName("name")); addProperty(propertyRegistry.getByName("invisible")); } + @Override + public void show(Player player) { + if (!getValue().equals(BLANK)) { + super.show(player); + } + } + @SuppressWarnings("unchecked") @Override public T getProperty(EntityProperty key) {