mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-26 12:46:04 +01:00
Fixes to per-player name holograms
This commit is contained in:
parent
4529f7dc39
commit
647215e8dd
@ -109,7 +109,7 @@ public class ProtocolLibListener implements Listener {
|
|||||||
|
|
||||||
for (WrappedDataValue wdv : wdvs) {
|
for (WrappedDataValue wdv : wdvs) {
|
||||||
if (fakeName != null && wdv.getIndex() == 2) {
|
if (fakeName != null && wdv.getIndex() == 2) {
|
||||||
wdv.setValue(fakeName);
|
wdv.setRawValue(fakeName);
|
||||||
delta = true;
|
delta = true;
|
||||||
} else if (sneaking && wdv.getIndex() == 0) {
|
} else if (sneaking && wdv.getIndex() == 0) {
|
||||||
byte b = (byte) (((Number) wdv.getValue()).byteValue() | 0x02);
|
byte b = (byte) (((Number) wdv.getValue()).byteValue() | 0x02);
|
||||||
|
@ -503,10 +503,10 @@ public class HologramTrait extends Trait {
|
|||||||
if (hologram != null) {
|
if (hologram != null) {
|
||||||
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);
|
|
||||||
if (Placeholders.containsPlaceholders(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().set(NPC.Metadata.NAMEPLATE_VISIBLE, ChatColor.stripColor(name).length() > 0);
|
||||||
hologram.data().remove(NPC.Metadata.HOLOGRAM_LINE_SUPPLIER);
|
hologram.data().remove(NPC.Metadata.HOLOGRAM_LINE_SUPPLIER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user