3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-11-20 06:50:09 +01:00
Dieser Commit ist enthalten in:
Camotoy 2023-02-07 13:14:06 -05:00
Ursprung f07f532d8e
Commit 6ee3d4ed96
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 7EEFB66FE798081F
3 geänderte Dateien mit 14 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -119,6 +119,8 @@ public class PlayerEntity extends LivingEntity {
setBelowNameText(objective); setBelowNameText(objective);
} }
// Update in case this entity has been despawned, then respawned
this.nametag = this.username;
// The name can't be updated later (the entity metadata for it is ignored), so we need to check for this now // The name can't be updated later (the entity metadata for it is ignored), so we need to check for this now
updateDisplayName(session.getWorldCache().getScoreboard().getTeamFor(username)); updateDisplayName(session.getWorldCache().getScoreboard().getTeamFor(username));
@ -339,6 +341,8 @@ public class PlayerEntity extends LivingEntity {
this.nametag = this.username; this.nametag = this.username;
} }
System.out.println(this.username + " " + this.nametag + " " + needsUpdate);
if (needsUpdate) { if (needsUpdate) {
dirtyMetadata.put(EntityData.NAMETAG, this.nametag); dirtyMetadata.put(EntityData.NAMETAG, this.nametag);
} }

Datei anzeigen

@ -352,7 +352,8 @@ public final class Scoreboard {
// With the player's lack of a team in visibility checks // With the player's lack of a team in visibility checks
updateEntityNames(remove, remove.getEntities(), true); updateEntityNames(remove, remove.getEntities(), true);
for (String name : remove.getEntities()) { for (String name : remove.getEntities()) {
playerToTeam.remove(name, remove); // 1.19.3 Mojmap Scoreboard#removePlayerTeam(PlayerTeam)
playerToTeam.remove(name);
} }
session.removeCommandEnum("Geyser_Teams", remove.getId()); session.removeCommandEnum("Geyser_Teams", remove.getId());

Datei anzeigen

@ -65,7 +65,14 @@ public final class Team {
if (entities.add(name)) { if (entities.add(name)) {
added.add(name); added.add(name);
} }
scoreboard.getPlayerToTeam().put(name, this); scoreboard.getPlayerToTeam().compute(name, (player, oldTeam) -> {
if (oldTeam != null) {
// Remove old team from this map, and from the set of players of the old team.
// Java 1.19.3 Mojmap: Scoreboard#addPlayerToTeam calls #removePlayerFromTeam
oldTeam.entities.remove(player);
}
return this;
});
} }
if (added.isEmpty()) { if (added.isEmpty()) {