initial 1.17 update changes

This commit is contained in:
Andrew So committed 2021-06-11 10:34:27 -07:00
1 parent 2813d02ae7
commit 6400602625
4 files changed
+69 -22

No files matched your search

@@ -44,7 +44,8 @@ def get_packets(context):
RespawnPacket,
PluginMessagePacket,
PlayerListHeaderAndFooterPacket,
EntityLookPacket
EntityLookPacket,
ResourcePackSendPacket
}
if context.protocol_earlier_eq(47):
packets |= {
@@ -64,7 +65,8 @@ def get_packets(context):
class KeepAlivePacket(AbstractKeepAlivePacket):
@staticmethod
def get_id(context):
return 0x1F if context.protocol_later_eq(741) else \
return 0x21 if context.protocol_later_eq(755) else \
0x1F if context.protocol_later_eq(741) else \
0x20 if context.protocol_later_eq(721) else \
0x21 if context.protocol_later_eq(550) else \
0x20 if context.protocol_later_eq(471) else \
@@ -79,7 +81,8 @@ class KeepAlivePacket(AbstractKeepAlivePacket):
class ServerDifficultyPacket(Packet):
@staticmethod
def get_id(context):
return 0x0D if context.protocol_later_eq(721) else \
return 0x0E if context.protocol_later_eq(755) else \
0x0D if context.protocol_later_eq(721) else \
0x0E if context.protocol_later_eq(550) else \
0x0D if context.protocol_later_eq(332) else \
0x0E if context.protocol_later_eq(318) else \
@@ -99,7 +102,8 @@ class ServerDifficultyPacket(Packet):
class ChatMessagePacket(Packet):
@staticmethod
def get_id(context):
return 0x0E if context.protocol_later_eq(721) else \
return 0x0F if context.protocol_later_eq(755) else \
0x0E if context.protocol_later_eq(721) else \
0x0F if context.protocol_later_eq(550) else \
0x0E if context.protocol_later_eq(343) else \
0x0F if context.protocol_later_eq(332) else \
@@ -123,7 +127,8 @@ class ChatMessagePacket(Packet):
class DisconnectPacket(Packet):
@staticmethod
def get_id(context):
return 0x19 if context.protocol_later_eq(741) else \
return 0x1A if context.protocol_later_eq(755) else \
0x19 if context.protocol_later_eq(741) else \
0x1A if context.protocol_later_eq(721) else \
0x1B if context.protocol_later_eq(550) else \
0x1A if context.protocol_later_eq(471) else \
@@ -141,7 +146,11 @@ class DisconnectPacket(Packet):
class SetCompressionPacket(Packet):
# Note: removed between protocol versions 47 and 107.
id = 0x46
@staticmethod
def get_id(context):
return 0x02 if context.protocol_later_eq(755) else \
0x46
packet_name = "set compression"
definition = [
{'threshold': VarInt}]
@@ -186,7 +195,8 @@ class SpawnPlayerPacket(Packet):
class EntityVelocityPacket(Packet):
@staticmethod
def get_id(context):
return 0x46 if context.protocol_later_eq(721) else \
return 0x4F if context.protocol_later_eq(755) else \
0x46 if context.protocol_later_eq(721) else \
0x47 if context.protocol_later_eq(707) else \
0x46 if context.protocol_later_eq(550) else \
0x45 if context.protocol_later_eq(471) else \
@@ -214,7 +224,8 @@ class EntityVelocityPacket(Packet):
class EntityPositionDeltaPacket(Packet):
@staticmethod
def get_id(context):
return 0x27 if context.protocol_later_eq(741) else \
return 0x29 if context.protocol_later_eq(755) else \
0x27 if context.protocol_later_eq(741) else \
0x28 if context.protocol_later_eq(721) else \
0x29 if context.protocol_later_eq(550) else \
0x28 if context.protocol_later_eq(389) else \
@@ -253,7 +264,8 @@ class EntityPositionDeltaPacket(Packet):
class TimeUpdatePacket(Packet):
@staticmethod
def get_id(context):
return 0x4E if context.protocol_later_eq(721) else \
return 0x58 if context.protocol_later_eq(755) else \
0x4E if context.protocol_later_eq(721) else \
0x4F if context.protocol_later_eq(550) else \
0x4E if context.protocol_later_eq(471) else \
0x4A if context.protocol_later_eq(461) else \
@@ -277,7 +289,8 @@ class TimeUpdatePacket(Packet):
class UpdateHealthPacket(Packet):
@staticmethod
def get_id(context):
return 0x49 if context.protocol_later_eq(721) else \
return 0x52 if context.protocol_later_eq(755) else \
0x49 if context.protocol_later_eq(721) else \
0x4A if context.protocol_later_eq(707) else \
0x49 if context.protocol_later_eq(550) else \
0x48 if context.protocol_later_eq(471) else \
@@ -304,7 +317,8 @@ class UpdateHealthPacket(Packet):
class PluginMessagePacket(AbstractPluginMessagePacket):
@staticmethod
def get_id(context):
return 0x17 if context.protocol_later_eq(741) else \
return 0x18 if context.protocol_later_eq(755) else \
0x17 if context.protocol_later_eq(741) else \
0x18 if context.protocol_later_eq(721) else \
0x19 if context.protocol_later_eq(550) else \
0x18 if context.protocol_later_eq(471) else \
@@ -318,7 +332,8 @@ class PluginMessagePacket(AbstractPluginMessagePacket):
class PlayerListHeaderAndFooterPacket(Packet):
@staticmethod
def get_id(context):
return 0x53 if context.protocol_later_eq(721) else \
return 0x5E if context.protocol_later_eq(755) else \
0x53 if context.protocol_later_eq(721) else \
0x54 if context.protocol_later_eq(550) else \
0x53 if context.protocol_later_eq(471) else \
0x5F if context.protocol_later_eq(461) else \
@@ -340,7 +355,8 @@ class PlayerListHeaderAndFooterPacket(Packet):
class EntityLookPacket(Packet):
@staticmethod
def get_id(context):
return 0x29 if context.protocol_later_eq(741) else \
return 0x3E if context.protocol_later_eq(755) else \
0x29 if context.protocol_later_eq(741) else \
0x2A if context.protocol_later_eq(721) else \
0x2B if context.protocol_later_eq(550) else \
0x2A if context.protocol_later_eq(389) else \
@@ -357,3 +373,15 @@ class EntityLookPacket(Packet):
{'pitch': Angle},
{'on_ground': Boolean}
]
class ResourcePackSendPacket(Packet):
@staticmethod
def get_id(context):
return 0x3C if context.protocol_later_eq(755) else \
0x38
packet_name = "resource pack send"
definition = [
{"url": String},
{"hash": String}
]
@@ -9,7 +9,8 @@ from minecraft.networking.types import (
class PlayerListItemPacket(Packet):
@staticmethod
def get_id(context):
return 0x32 if context.protocol_later_eq(741) else \
return 0x36 if context.protocol_later_eq(755) else \
0x32 if context.protocol_later_eq(741) else \
0x33 if context.protocol_later_eq(721) else \
0x34 if context.protocol_later_eq(550) else \
0x33 if context.protocol_later_eq(471) else \