Use new method

This commit is contained in:
fullwall 2024-01-18 15:37:37 +08:00
parent 0c046a00b1
commit 4529f7dc39

View File

@ -504,7 +504,7 @@ public class HologramTrait extends Trait {
String name = Placeholders.replace(text, null, npc);
hologram.setName(name);
hologram.data().set(NPC.Metadata.NAMEPLATE_VISIBLE, ChatColor.stripColor(name).length() > 0);
if (Placeholders.containsPlayerPlaceholder(text)) {
if (Placeholders.containsPlaceholders(text)) {
hologram.data().set(NPC.Metadata.HOLOGRAM_LINE_SUPPLIER, this);
} else {
hologram.data().remove(NPC.Metadata.HOLOGRAM_LINE_SUPPLIER);
@ -518,7 +518,7 @@ public class HologramTrait extends Trait {
if (customHologramSupplier != null) {
hologram.data().set(NPC.Metadata.HOLOGRAM_LINE_SUPPLIER,
(Function<Player, String>) p -> customHologramSupplier.apply(text, p));
} else if (Placeholders.containsPlayerPlaceholder(text)) {
} else if (Placeholders.containsPlaceholders(text)) {
hologram.data().set(NPC.Metadata.HOLOGRAM_LINE_SUPPLIER, this);
}
}