%blank% for empty hologram line
This commit is contained in:
parent
26442f2e3e
commit
4d54dd8512
1 changed files with 10 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue