%blank% for empty hologram line

This commit is contained in:
D3v1s0m 2024-06-11 21:31:00 +05:30
parent 26442f2e3e
commit 4d54dd8512
No known key found for this signature in database
GPG Key ID: FA1F770C7B1D40C1

@ -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<Component> {
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> T getProperty(EntityProperty<T> key) {