From bf719611ec11c0175c429b63d9ca3b2878f605e7 Mon Sep 17 00:00:00 2001 From: joodicator Date: Mon, 13 May 2019 18:22:53 +0200 Subject: [PATCH] Update RespawnPacket and ServerDifficultyPacket to 1.14. --- .../networking/packets/clientbound/play/__init__.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/minecraft/networking/packets/clientbound/play/__init__.py b/minecraft/networking/packets/clientbound/play/__init__.py index 1c612f1..b13a576 100644 --- a/minecraft/networking/packets/clientbound/play/__init__.py +++ b/minecraft/networking/packets/clientbound/play/__init__.py @@ -100,7 +100,8 @@ class ServerDifficultyPacket(Packet): packet_name = 'server difficulty' get_definition = staticmethod(lambda context: [ - {'difficulty': UnsignedByte} + {'difficulty': UnsignedByte}, + {'is_locked': Boolean} if context.protocol_version >= 464 else {}, ]) # ServerDifficultyPacket.Difficulty is an alias for Difficulty @@ -226,7 +227,10 @@ class UpdateHealthPacket(Packet): class RespawnPacket(Packet): @staticmethod def get_id(context): - return 0x38 if context.protocol_version >= 389 else \ + return 0x3A if context.protocol_version >= 471 else \ + 0x38 if context.protocol_version >= 461 else \ + 0x39 if context.protocol_version >= 451 else \ + 0x38 if context.protocol_version >= 389 else \ 0x37 if context.protocol_version >= 352 else \ 0x36 if context.protocol_version >= 345 else \ 0x35 if context.protocol_version >= 336 else \ @@ -238,9 +242,9 @@ class RespawnPacket(Packet): packet_name = 'respawn' get_definition = staticmethod(lambda context: [ {'dimension': Integer}, - {'difficulty': UnsignedByte}, + {'difficulty': UnsignedByte} if context.protocol_version < 464 else {}, {'game_mode': UnsignedByte}, - {'level_type': String} + {'level_type': String}, ]) # RespawnPacket.Difficulty is an alias for Difficulty.