Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-25 15:50:14 +01:00
Fix edge case in removing below name objectives
Dieser Commit ist enthalten in:
Ursprung
86c0c009e7
Commit
b58cbd00bc
@ -355,7 +355,9 @@ public class PlayerEntity extends LivingEntity {
|
||||
session.sendUpstreamPacket(packet);
|
||||
}
|
||||
} else {
|
||||
if (valid && metadata.remove(EntityData.SCORE_TAG) != null) {
|
||||
// Always remove the score tag first, then check for valid.
|
||||
// That way the score tag is removed if the player was spawned, then despawned, and is being respawned
|
||||
if (metadata.remove(EntityData.SCORE_TAG) != null && valid) {
|
||||
SetEntityDataPacket packet = new SetEntityDataPacket();
|
||||
packet.setRuntimeEntityId(geyserId);
|
||||
packet.getMetadata().put(EntityData.SCORE_TAG, "");
|
||||
|
@ -70,11 +70,9 @@ public class JavaScoreboardObjectiveTranslator extends PacketTranslator<ServerSc
|
||||
if (objective != null && objective == scoreboard.getObjectiveSlots().get(ScoreboardPosition.BELOW_NAME)) {
|
||||
// Clear the score tag from all players
|
||||
for (PlayerEntity entity : session.getEntityCache().getAllPlayerEntities()) {
|
||||
if (!entity.isValid()) {
|
||||
// Player hasn't spawned yet - don't bother
|
||||
continue;
|
||||
}
|
||||
|
||||
// Other places we check for the entity being valid,
|
||||
// but we must set the below name text as null for all players
|
||||
// or else PlayerEntity#spawnEntity will find a null objective and not touch EntityData#SCORE_TAG
|
||||
entity.setBelowNameText(session, null);
|
||||
}
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren