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
This commit is contained in:
Leon 2024-06-16 22:06:39 +02:00 committed by GitHub
parent b367caa4b2
commit 8bec05ed38
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -196,7 +196,9 @@ public class PlayerPacketRewriter1_9 {
handler(wrapper -> {
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