mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-09-27 14:53:09 +02:00
Use new method
This commit is contained in:
parent
0c046a00b1
commit
4529f7dc39
@ -504,7 +504,7 @@ public class HologramTrait extends Trait {
|
|||||||
String name = Placeholders.replace(text, null, npc);
|
String name = Placeholders.replace(text, null, npc);
|
||||||
hologram.setName(name);
|
hologram.setName(name);
|
||||||
hologram.data().set(NPC.Metadata.NAMEPLATE_VISIBLE, ChatColor.stripColor(name).length() > 0);
|
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);
|
hologram.data().set(NPC.Metadata.HOLOGRAM_LINE_SUPPLIER, this);
|
||||||
} else {
|
} else {
|
||||||
hologram.data().remove(NPC.Metadata.HOLOGRAM_LINE_SUPPLIER);
|
hologram.data().remove(NPC.Metadata.HOLOGRAM_LINE_SUPPLIER);
|
||||||
@ -518,7 +518,7 @@ public class HologramTrait extends Trait {
|
|||||||
if (customHologramSupplier != null) {
|
if (customHologramSupplier != null) {
|
||||||
hologram.data().set(NPC.Metadata.HOLOGRAM_LINE_SUPPLIER,
|
hologram.data().set(NPC.Metadata.HOLOGRAM_LINE_SUPPLIER,
|
||||||
(Function<Player, String>) p -> customHologramSupplier.apply(text, p));
|
(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);
|
hologram.data().set(NPC.Metadata.HOLOGRAM_LINE_SUPPLIER, this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user