mirror of
https://github.com/ammaraskar/pyCraft.git
synced 2024-11-29 13:45:11 +01:00
18 lines
422 B
Python
18 lines
422 B
Python
from .packet import Packet
|
|
|
|
from minecraft.networking.types import (
|
|
VarInt, Long
|
|
)
|
|
|
|
|
|
class AbstractKeepAlivePacket(Packet):
|
|
packet_name = "keep alive"
|
|
get_definition = staticmethod(lambda context: [
|
|
{'keep_alive_id': Long} if context.protocol_version >= 339
|
|
else {'keep_alive_id': VarInt}
|
|
])
|
|
|
|
|
|
# This alias is retained for backward compatibility:
|
|
KeepAlivePacket = AbstractKeepAlivePacket
|