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

Fixup hardcore handling on join in 1.8->1.9 (#3946)

* Fix players crashing when logging into a 1.8 server on hardcore mode, Fixes #3944

* Requested change to #3944 fix
Dieser Commit ist enthalten in:
Leon 2024-06-16 22:06:39 +02:00 committet von GitHub
Ursprung b367caa4b2
Commit 8bec05ed38
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: B5690EEEBB952194

Datei anzeigen

@ -196,7 +196,9 @@ public class PlayerPacketRewriter1_9 {
handler(wrapper -> { handler(wrapper -> {
EntityTracker1_9 tracker = wrapper.user().getEntityTracker(Protocol1_8To1_9.class); EntityTracker1_9 tracker = wrapper.user().getEntityTracker(Protocol1_8To1_9.class);
tracker.setGameMode(GameMode.getById(wrapper.get(Types.UNSIGNED_BYTE, 0))); //Set player gamemode short gamemodeId = wrapper.get(Types.UNSIGNED_BYTE, 0);
gamemodeId &= -9; // remove the hardcore mode flag
tracker.setGameMode(GameMode.getById(gamemodeId)); //Set player gamemode
}); });
// Track player's dimension // Track player's dimension