Added support for snapshot 20w12a
This commit is contained in:
1 parent
5c6edf5e44
commit
76f7b4bdc9
5 files changed
+35
-8
No files matched your search
@@ -1,7 +1,8 @@
|
||||
from minecraft.networking.packets import Packet
|
||||
|
||||
from minecraft.networking.types import (
|
||||
VarInt, String, VarIntPrefixedByteArray, TrailingByteArray
|
||||
VarInt, String, VarIntPrefixedByteArray, TrailingByteArray,
|
||||
UUIDIntegerArray
|
||||
)
|
||||
|
||||
|
||||
@@ -54,9 +55,11 @@ class LoginSuccessPacket(Packet):
|
||||
0x02
|
||||
|
||||
packet_name = "login success"
|
||||
definition = [
|
||||
{'UUID': String},
|
||||
{'Username': String}]
|
||||
get_definition = staticmethod(lambda context: [
|
||||
{'UUID': UUIDIntegerArray} if context.protocol_version >= 707
|
||||
else {'UUID': String},
|
||||
{'Username': String}
|
||||
])
|
||||
|
||||
|
||||
class SetCompressionPacket(Packet):
|
||||
|
||||
@@ -206,7 +206,8 @@ class SpawnPlayerPacket(Packet):
|
||||
class EntityVelocityPacket(Packet):
|
||||
@staticmethod
|
||||
def get_id(context):
|
||||
return 0x46 if context.protocol_version >= 550 else \
|
||||
return 0x47 if context.protocol_version >= 707 else \
|
||||
0x46 if context.protocol_version >= 550 else \
|
||||
0x45 if context.protocol_version >= 471 else \
|
||||
0x41 if context.protocol_version >= 461 else \
|
||||
0x42 if context.protocol_version >= 451 else \
|
||||
@@ -232,7 +233,8 @@ class EntityVelocityPacket(Packet):
|
||||
class UpdateHealthPacket(Packet):
|
||||
@staticmethod
|
||||
def get_id(context):
|
||||
return 0x49 if context.protocol_version >= 550 else \
|
||||
return 0x4A if context.protocol_version >= 707 else \
|
||||
0x49 if context.protocol_version >= 550 else \
|
||||
0x48 if context.protocol_version >= 471 else \
|
||||
0x44 if context.protocol_version >= 461 else \
|
||||
0x45 if context.protocol_version >= 451 else \
|
||||
|
||||
@@ -13,7 +13,6 @@ class SoundEffectPacket(Packet):
|
||||
0x51 if context.protocol_version >= 471 else \
|
||||
0x4D if context.protocol_version >= 461 else \
|
||||
0x4E if context.protocol_version >= 451 else \
|
||||
0x4E if context.protocol_version >= 451 else \
|
||||
0x4D if context.protocol_version >= 389 else \
|
||||
0x4C if context.protocol_version >= 352 else \
|
||||
0x4B if context.protocol_version >= 345 else \
|
||||
|
||||
Reference in new issue
Block a user