Add support for Minecraft 17w31a and 1.12.1-pre1 (protocols 336 and 337).

This commit is contained in:
joo committed 2017-08-03 18:31:00 +01:00
1 parent cf464d2da2
commit 5aa2d3df59
2 files changed
+12 -5

No files matched your search

+2
View File
@@ -61,6 +61,8 @@ SUPPORTED_MINECRAFT_VERSIONS = {
'1.12-pre6': 333, '1.12-pre6': 333,
'1.12-pre7': 334, '1.12-pre7': 334,
'1.12': 335, '1.12': 335,
'17w31a': 336,
'1.12.1-pre1': 337,
} }
SUPPORTED_PROTOCOL_VERSIONS = sorted(SUPPORTED_MINECRAFT_VERSIONS.values()) SUPPORTED_PROTOCOL_VERSIONS = sorted(SUPPORTED_MINECRAFT_VERSIONS.values())
+10 -5
View File
@@ -307,7 +307,8 @@ class KeepAlivePacketClientbound(KeepAlivePacket):
class KeepAlivePacketServerbound(KeepAlivePacket): class KeepAlivePacketServerbound(KeepAlivePacket):
@staticmethod @staticmethod
def get_id(context): def get_id(context):
return 0x0C if context.protocol_version >= 318 else \ return 0x0B if context.protocol_version >= 336 else \
0x0C if context.protocol_version >= 318 else \
0x0B if context.protocol_version >= 107 else \ 0x0B if context.protocol_version >= 107 else \
0x00 0x00
@@ -348,7 +349,8 @@ class ChatMessagePacket(Packet):
class PlayerPositionAndLookPacket(Packet): class PlayerPositionAndLookPacket(Packet):
@staticmethod @staticmethod
def get_id(context): def get_id(context):
return 0x2E if context.protocol_version >= 318 else \ return 0x2F if context.protocol_version >= 336 else \
0x2E if context.protocol_version >= 318 else \
0x2F if context.protocol_version >= 107 else \ 0x2F if context.protocol_version >= 107 else \
0x08 0x08
@@ -433,7 +435,8 @@ class SetCompressionPacketPlayState(Packet):
class PlayerListItemPacket(Packet): class PlayerListItemPacket(Packet):
@staticmethod @staticmethod
def get_id(context): def get_id(context):
return 0x2D if context.protocol_version >= 332 else \ return 0x2E if context.protocol_version >= 336 else \
0x2D if context.protocol_version >= 332 else \
0x2E if context.protocol_version >= 318 else \ 0x2E if context.protocol_version >= 318 else \
0x2D if context.protocol_version >= 107 else \ 0x2D if context.protocol_version >= 107 else \
0x38 0x38
@@ -744,7 +747,8 @@ def state_playing_clientbound(context):
class ChatPacket(Packet): class ChatPacket(Packet):
@staticmethod @staticmethod
def get_id(context): def get_id(context):
return 0x03 if context.protocol_version >= 318 else \ return 0x02 if context.protocol_version >= 336 else \
0x03 if context.protocol_version >= 318 else \
0x02 if context.protocol_version >= 107 else \ 0x02 if context.protocol_version >= 107 else \
0x01 0x01
@@ -766,7 +770,8 @@ class ChatPacket(Packet):
class PositionAndLookPacket(Packet): class PositionAndLookPacket(Packet):
@staticmethod @staticmethod
def get_id(context): def get_id(context):
return 0x0F if context.protocol_version >= 332 else \ return 0x0E if context.protocol_version >= 336 else \
0x0F if context.protocol_version >= 332 else \
0x0E if context.protocol_version >= 318 else \ 0x0E if context.protocol_version >= 318 else \
0x0D if context.protocol_version >= 107 else \ 0x0D if context.protocol_version >= 107 else \
0x06 0x06