Edit definition of SoundEffectPacket
This commit is contained in:
1 parent
56d1300db1
commit
1a1b9803f8
1 file changed
+8
-11
@@ -229,24 +229,21 @@ class SoundEffectPacket(Packet):
|
|||||||
0x2C
|
0x2C
|
||||||
|
|
||||||
packet_name = 'sound effect'
|
packet_name = 'sound effect'
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_definition(context):
|
def get_definition(context):
|
||||||
definition = [
|
definition = [
|
||||||
|
{'sound_id': VarInt},
|
||||||
|
{'sound_category': VarInt} if context.protocol_version >= 95 else {},
|
||||||
|
{'parrotted_entity_type': String} if 326 > context.protocol_version >= 321 else {},
|
||||||
{'effect_position_x': Integer},
|
{'effect_position_x': Integer},
|
||||||
{'effect_position_y': Integer},
|
{'effect_position_y': Integer},
|
||||||
{'effect_position_z': Integer},
|
{'effect_position_z': Integer},
|
||||||
{'volume': Float},
|
{'volume': Float},
|
||||||
{'pitch': Float},
|
{'pitch': Float if context.protocol_version >= 201 else UnsignedByte}
|
||||||
]
|
]
|
||||||
|
|
||||||
if context.protocol_version >= 94:
|
if 326 > context.protocol_version >= 321:
|
||||||
definition.insert(0, {'sound_id': VarInt})
|
# Swaps the position of sound category and -id
|
||||||
else:
|
definition[0], definition[1] = definition[1], definition[0]
|
||||||
definition.insert(0, {'sound_name': String})
|
|
||||||
|
|
||||||
if context.protocol_version >= 95:
|
|
||||||
definition.insert(1, {'sound_category': VarInt})
|
|
||||||
elif context.protocol_version == 0:
|
|
||||||
definition.append({'sound_category': UnsignedByte})
|
|
||||||
|
|
||||||
return definition
|
return definition
|
||||||
Reference in new issue
Block a user