3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-12-26 00:00:41 +01:00

Reset the scoreboard in the configuration stage

Dieser Commit ist enthalten in:
Tim203 2024-11-02 11:48:58 +01:00
Ursprung 67a1805fa6
Commit d61ad7baef
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
3 geänderte Dateien mit 7 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -81,7 +81,7 @@ public final class WorldCache {
resetTitleTimes(false); resetTitleTimes(false);
} }
public void removeScoreboard() { public void resetScoreboard() {
scoreboard.removeScoreboard(); scoreboard.removeScoreboard();
scoreboard = new Scoreboard(session); scoreboard = new Scoreboard(session);
} }

Datei anzeigen

@ -45,5 +45,11 @@ public class JavaFinishConfigurationPacketTranslator extends PacketTranslator<Cl
} }
session.sendUpstreamPacket(playerListPacket); session.sendUpstreamPacket(playerListPacket);
session.getEntityCache().removeAllPlayerEntities(); session.getEntityCache().removeAllPlayerEntities();
// while ClientboundLoginPacket holds the level, it doesn't hold the scoreboard.
// The ClientboundStartConfigurationPacket indirectly removes the old scoreboard,
// and this packet indirectly creates the new one.
// This makes this packet a good place to reset the scoreboard.
session.getWorldCache().resetScoreboard();
} }
} }

Datei anzeigen

@ -71,8 +71,6 @@ public class JavaLoginTranslator extends PacketTranslator<ClientboundLoginPacket
DimensionUtils.fastSwitchDimension(session, fakeDim); DimensionUtils.fastSwitchDimension(session, fakeDim);
} }
session.getWorldCache().removeScoreboard();
// Remove all bossbars // Remove all bossbars
session.getEntityCache().removeAllBossBars(); session.getEntityCache().removeAllBossBars();
// Remove extra hearts, hunger, etc. // Remove extra hearts, hunger, etc.