3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-11-19 14:30:17 +01:00

Fix: Nametags are not shown in some other cases (#4447)

Dieser Commit ist enthalten in:
byquanton 2024-02-15 22:22:46 +01:00 committet von GitHub
Ursprung e97258f625
Commit 8b170d656e
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: B5690EEEBB952194

Datei anzeigen

@ -120,9 +120,6 @@ public class PlayerEntity extends LivingEntity implements GeyserPlayerEntity {
super.initializeMetadata(); super.initializeMetadata();
// For the OptionalPack, set all bits as invisible by default as this matches Java Edition behavior // For the OptionalPack, set all bits as invisible by default as this matches Java Edition behavior
dirtyMetadata.put(EntityDataTypes.MARK_VARIANT, 0xff); dirtyMetadata.put(EntityDataTypes.MARK_VARIANT, 0xff);
// Since 1.20.60, the nametag does not show properly if this is not set :/
// The nametag does disappear properly when the player is invisible though.
dirtyMetadata.put(EntityDataTypes.NAMETAG_ALWAYS_SHOW, (byte) 1);
} }
@Override @Override
@ -154,6 +151,10 @@ public class PlayerEntity extends LivingEntity implements GeyserPlayerEntity {
addPlayerPacket.setGameType(GameType.SURVIVAL); //TODO addPlayerPacket.setGameType(GameType.SURVIVAL); //TODO
addPlayerPacket.setAbilityLayers(BASE_ABILITY_LAYER); // Recommended to be added since 1.19.10, but only needed here for permissions viewing addPlayerPacket.setAbilityLayers(BASE_ABILITY_LAYER); // Recommended to be added since 1.19.10, but only needed here for permissions viewing
addPlayerPacket.getMetadata().putFlags(flags); addPlayerPacket.getMetadata().putFlags(flags);
// Since 1.20.60, the nametag does not show properly if this is not set :/
// The nametag does disappear properly when the player is invisible though.
dirtyMetadata.put(EntityDataTypes.NAMETAG_ALWAYS_SHOW, (byte) 1);
dirtyMetadata.apply(addPlayerPacket.getMetadata()); dirtyMetadata.apply(addPlayerPacket.getMetadata());
setFlagsDirty(false); setFlagsDirty(false);
@ -377,7 +378,6 @@ public class PlayerEntity extends LivingEntity implements GeyserPlayerEntity {
if (needsUpdate) { if (needsUpdate) {
dirtyMetadata.put(EntityDataTypes.NAME, this.nametag); dirtyMetadata.put(EntityDataTypes.NAME, this.nametag);
dirtyMetadata.put(EntityDataTypes.NAMETAG_ALWAYS_SHOW, (byte) 1);
} }
} }