mirror of
https://github.com/ammaraskar/pyCraft.git
synced 2024-11-25 19:56:27 +01:00
Implement clientbound.play.ServerDifficultyPacket
This commit is contained in:
parent
d20344cac1
commit
1a114c1b95
@ -21,6 +21,7 @@ def get_packets(context):
|
|||||||
packets = {
|
packets = {
|
||||||
KeepAlivePacket,
|
KeepAlivePacket,
|
||||||
JoinGamePacket,
|
JoinGamePacket,
|
||||||
|
ServerDifficultyPacket,
|
||||||
ChatMessagePacket,
|
ChatMessagePacket,
|
||||||
PlayerPositionAndLookPacket,
|
PlayerPositionAndLookPacket,
|
||||||
MapPacket,
|
MapPacket,
|
||||||
@ -73,7 +74,21 @@ class JoinGamePacket(Packet):
|
|||||||
{'difficulty': UnsignedByte},
|
{'difficulty': UnsignedByte},
|
||||||
{'max_players': UnsignedByte},
|
{'max_players': UnsignedByte},
|
||||||
{'level_type': String},
|
{'level_type': String},
|
||||||
{'reduced_debug_info': Boolean}])
|
{'reduced_debug_info': Boolean}
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
|
class ServerDifficultyPacket(Packet):
|
||||||
|
def get_id(context):
|
||||||
|
return 0x0D if context.protocol_version >= 332 else \
|
||||||
|
0x0E if context.protocol_version >= 318 else \
|
||||||
|
0x0D if context.protocol_version >= 67 else \
|
||||||
|
0x41
|
||||||
|
|
||||||
|
packet_name = 'server difficulty'
|
||||||
|
get_definition = staticmethod(lambda context: [
|
||||||
|
{'difficulty': UnsignedByte}
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
class ChatMessagePacket(Packet):
|
class ChatMessagePacket(Packet):
|
||||||
|
Loading…
Reference in New Issue
Block a user