Add aliases for Enums in Packet Definitions

This commit is contained in:
Zachy24 committed 2018-08-13 00:41:21 +01:00
1 parent aeaf7b5bcb
commit 4ba6a40df6
1 file changed
+22 -1
@@ -77,6 +77,15 @@ class JoinGamePacket(Packet):
{'reduced_debug_info': Boolean}
])
# JoinGamePacket.Difficulty is an alias for Difficulty
Difficulty = Difficulty
# JoinGamePacket.Gamemode is an alias for Gamemode
Gamemode = Gamemode
# JoinGamePacket.Dimension is an alias for Dimension
Dimension = Dimension
class ServerDifficultyPacket(Packet):
@staticmethod
@@ -88,9 +97,12 @@ class ServerDifficultyPacket(Packet):
packet_name = 'server difficulty'
get_definition = staticmethod(lambda context: [
{'difficulty': UnsignedByte}
{'difficulty_enum': UnsignedByte}
])
# ServerDifficultyPacket.Difficulty is an alias for Difficulty
Difficulty = Difficulty
class ChatMessagePacket(Packet):
@staticmethod
@@ -221,6 +233,15 @@ class RespawnPacket(Packet):
{'level_type': String}
])
# RespawnPacket.Difficulty is an alias for Difficulty.
Difficulty = Difficulty
# RespawnPacket.Dimension is an alias for Dimension.
Dimension = Dimension
# RespawnPacket.Gamemode is an alias for Gamemode.
Gamemode = Gamemode
class PluginMessagePacket(AbstractPluginMessagePacket):
@staticmethod