Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-11-20 06:50:09 +01:00
Fix #3537
Dieser Commit ist enthalten in:
Ursprung
f07f532d8e
Commit
6ee3d4ed96
@ -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);
|
||||||
}
|
}
|
||||||
|
@ -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());
|
||||||
|
@ -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()) {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren