mirror of
https://github.com/ammaraskar/pyCraft.git
synced 2025-01-03 14:37:48 +01:00
Add support for Minecraft snapshot 17w13a (protocol 318).
This commit is contained in:
parent
b0f15ed5a2
commit
73672401ef
@ -43,6 +43,7 @@ SUPPORTED_MINECRAFT_VERSIONS = {
|
|||||||
'1.11.1': 316,
|
'1.11.1': 316,
|
||||||
'1.11.2': 316,
|
'1.11.2': 316,
|
||||||
'17w06a': 317,
|
'17w06a': 317,
|
||||||
|
'17w13a': 318,
|
||||||
}
|
}
|
||||||
|
|
||||||
SUPPORTED_PROTOCOL_VERSIONS = sorted(SUPPORTED_MINECRAFT_VERSIONS.values())
|
SUPPORTED_PROTOCOL_VERSIONS = sorted(SUPPORTED_MINECRAFT_VERSIONS.values())
|
||||||
|
@ -293,21 +293,24 @@ class KeepAlivePacket(Packet):
|
|||||||
class KeepAlivePacketClientbound(KeepAlivePacket):
|
class KeepAlivePacketClientbound(KeepAlivePacket):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_id(context):
|
def get_id(context):
|
||||||
return 0x1F if context.protocol_version >= 107 else \
|
return 0x20 if context.protocol_version >= 318 else \
|
||||||
|
0x1F if context.protocol_version >= 107 else \
|
||||||
0x00
|
0x00
|
||||||
|
|
||||||
|
|
||||||
class KeepAlivePacketServerbound(KeepAlivePacket):
|
class KeepAlivePacketServerbound(KeepAlivePacket):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_id(context):
|
def get_id(context):
|
||||||
return 0x0B if context.protocol_version >= 107 else \
|
return 0x0C if context.protocol_version >= 318 else \
|
||||||
|
0x0B if context.protocol_version >= 107 else \
|
||||||
0x00
|
0x00
|
||||||
|
|
||||||
|
|
||||||
class JoinGamePacket(Packet):
|
class JoinGamePacket(Packet):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_id(context):
|
def get_id(context):
|
||||||
return 0x23 if context.protocol_version >= 107 else \
|
return 0x24 if context.protocol_version >= 318 else \
|
||||||
|
0x23 if context.protocol_version >= 107 else \
|
||||||
0x01
|
0x01
|
||||||
|
|
||||||
packet_name = "join game"
|
packet_name = "join game"
|
||||||
@ -324,7 +327,8 @@ class JoinGamePacket(Packet):
|
|||||||
class ChatMessagePacket(Packet):
|
class ChatMessagePacket(Packet):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_id(context):
|
def get_id(context):
|
||||||
return 0x0F if context.protocol_version >= 107 else \
|
return 0x10 if context.protocol_version >= 317 else \
|
||||||
|
0x0F if context.protocol_version >= 107 else \
|
||||||
0x02
|
0x02
|
||||||
|
|
||||||
packet_name = "chat message"
|
packet_name = "chat message"
|
||||||
@ -336,7 +340,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 >= 107 else \
|
return 0x2F if context.protocol_version >= 318 else \
|
||||||
|
0x2E if context.protocol_version >= 107 else \
|
||||||
0x08
|
0x08
|
||||||
|
|
||||||
packet_name = "player position and look"
|
packet_name = "player position and look"
|
||||||
@ -398,7 +403,8 @@ class PlayerPositionAndLookPacket(Packet):
|
|||||||
class DisconnectPacketPlayState(Packet):
|
class DisconnectPacketPlayState(Packet):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_id(context):
|
def get_id(context):
|
||||||
return 0x1A if context.protocol_version >= 107 else \
|
return 0x1B if context.protocol_version >= 318 else \
|
||||||
|
0x1A if context.protocol_version >= 107 else \
|
||||||
0x40
|
0x40
|
||||||
|
|
||||||
packet_name = "disconnect"
|
packet_name = "disconnect"
|
||||||
@ -418,7 +424,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 >= 107 else \
|
return 0x2E if context.protocol_version >= 318 else \
|
||||||
|
0x2D if context.protocol_version >= 107 else \
|
||||||
0x38
|
0x38
|
||||||
|
|
||||||
packet_name = "player list item"
|
packet_name = "player list item"
|
||||||
@ -569,7 +576,8 @@ class PlayerListItemPacket(Packet):
|
|||||||
class MapPacket(Packet):
|
class MapPacket(Packet):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_id(context):
|
def get_id(context):
|
||||||
return 0x24 if context.protocol_version >= 107 else \
|
return 0x25 if context.protocol_version >= 318 else \
|
||||||
|
0x24 if context.protocol_version >= 107 else \
|
||||||
0x34
|
0x34
|
||||||
|
|
||||||
packet_name = 'map'
|
packet_name = 'map'
|
||||||
@ -701,7 +709,8 @@ def state_playing_clientbound(context):
|
|||||||
class ChatPacket(Packet):
|
class ChatPacket(Packet):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_id(context):
|
def get_id(context):
|
||||||
return 0x02 if context.protocol_version >= 107 else \
|
return 0x03 if context.protocol_version >= 318 else \
|
||||||
|
0x02 if context.protocol_version >= 107 else \
|
||||||
0x01
|
0x01
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@ -722,7 +731,8 @@ class ChatPacket(Packet):
|
|||||||
class PositionAndLookPacket(Packet):
|
class PositionAndLookPacket(Packet):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_id(context):
|
def get_id(context):
|
||||||
return 0x0D if context.protocol_version >= 107 else \
|
return 0x0E if context.protocol_version >= 318 else \
|
||||||
|
0x0D if context.protocol_version >= 107 else \
|
||||||
0x06
|
0x06
|
||||||
|
|
||||||
packet_name = "position and look"
|
packet_name = "position and look"
|
||||||
@ -746,7 +756,8 @@ class TeleportConfirmPacket(Packet):
|
|||||||
class AnimationPacketServerbound(Packet):
|
class AnimationPacketServerbound(Packet):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_id(context):
|
def get_id(context):
|
||||||
return 0x1A if context.protocol_version >= 107 else \
|
return 0x1C if context.protocol_version >= 318 else \
|
||||||
|
0x1A if context.protocol_version >= 107 else \
|
||||||
0x0A
|
0x0A
|
||||||
|
|
||||||
packet_name = "animation"
|
packet_name = "animation"
|
||||||
|
Loading…
Reference in New Issue
Block a user