From 7f2023176f8f37bede50856d8b7888e4a5f0e5f5 Mon Sep 17 00:00:00 2001 From: KennyTV Date: Wed, 1 Jul 2020 20:02:44 +0200 Subject: [PATCH] Fix hardcore flag --- .../protocol1_16_2to1_16_1/packets/EntityPackets.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_16_2to1_16_1/packets/EntityPackets.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_16_2to1_16_1/packets/EntityPackets.java index f488d7df5..b2d4d70a5 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_16_2to1_16_1/packets/EntityPackets.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_16_2to1_16_1/packets/EntityPackets.java @@ -26,7 +26,10 @@ public class EntityPackets { @Override public void registerMap() { map(Type.INT); // Entity ID - handler(wrapper -> wrapper.write(Type.BOOLEAN, false)); // Hardcore //TODO save? + handler(wrapper -> { + short gamemode = wrapper.passthrough(Type.UNSIGNED_BYTE); + wrapper.write(Type.BOOLEAN, (gamemode & 0x08) != 0); // Hardcore + }); map(Type.UNSIGNED_BYTE); // Gamemode map(Type.BYTE); // Previous Gamemode map(Type.STRING_ARRAY); // World List