From 9c08c6c9f5e27818b3f56676e548523ceb452701 Mon Sep 17 00:00:00 2001 From: Tristan Gosselin-Hane Date: Thu, 14 May 2020 21:37:25 -0400 Subject: [PATCH] Added support for snapshots 20w20a and 20w20b --- minecraft/__init__.py | 2 ++ minecraft/networking/packets/clientbound/play/__init__.py | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/minecraft/__init__.py b/minecraft/__init__.py index e490e0f..fc6baac 100644 --- a/minecraft/__init__.py +++ b/minecraft/__init__.py @@ -240,6 +240,8 @@ SUPPORTED_MINECRAFT_VERSIONS = { '20w17a': 713, '20w18a': 714, '20w19a': 715, + '20w20a': 716, + '20w20b': 717, } # Those Minecraft versions supported by pyCraft which are "release" versions, diff --git a/minecraft/networking/packets/clientbound/play/__init__.py b/minecraft/networking/packets/clientbound/play/__init__.py index 394f930..acced08 100644 --- a/minecraft/networking/packets/clientbound/play/__init__.py +++ b/minecraft/networking/packets/clientbound/play/__init__.py @@ -91,10 +91,12 @@ class JoinGamePacket(Packet): {'hashed_seed': Long} if context.protocol_version >= 552 else {}, {'difficulty': UnsignedByte} if context.protocol_version < 464 else {}, {'max_players': UnsignedByte}, - {'level_type': String}, + {'level_type': String} if context.protocol_version < 716 else {}, {'render_distance': VarInt} if context.protocol_version >= 468 else {}, {'reduced_debug_info': Boolean}, {'respawn_screen': Boolean} if context.protocol_version >= 571 else {}, + {'is_debug': String} if context.protocol_version >= 716 else {}, + {'is_flat': String} if context.protocol_version >= 716 else {}, ]) # These aliases declare the Enum type corresponding to each field: @@ -278,7 +280,9 @@ class RespawnPacket(Packet): {'difficulty': UnsignedByte} if context.protocol_version < 464 else {}, {'hashed_seed': Long} if context.protocol_version >= 552 else {}, {'game_mode': UnsignedByte}, - {'level_type': String}, + {'level_type': String} if context.protocol_version < 716 else {}, + {'is_debug': String} if context.protocol_version >= 716 else {}, + {'is_flat': String} if context.protocol_version >= 716 else {}, {'copy_metadata': Boolean}, ])