Fix hardcore flag

This commit is contained in:
KennyTV 2020-07-01 20:02:44 +02:00
parent 3ddd289b49
commit 7f2023176f
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B

View File

@ -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