mirror of
https://github.com/ammaraskar/pyCraft.git
synced 2025-01-22 23:51:28 +01:00
better packet names to match new packet structure
This commit is contained in:
parent
64cf23436b
commit
61b07f52f2
@ -13,7 +13,7 @@ from .serverbound.handshake import get_packets as state_handshake_serverbound
|
||||
# Status State
|
||||
# ==============
|
||||
from .clientbound.status import ResponsePacket
|
||||
from .clientbound.status import PingPacketResponse
|
||||
from .clientbound.status import PingResponsePacket as PingPacketResponse
|
||||
from .clientbound.status import get_packets as state_status_clientbound
|
||||
from .serverbound.status import RequestPacket
|
||||
from .serverbound.status import PingPacket
|
||||
@ -37,8 +37,10 @@ from .serverbound.play import KeepAlivePacket as KeepAlivePacketServerbound
|
||||
from .clientbound.play import JoinGamePacket
|
||||
from .clientbound.play import ChatMessagePacket
|
||||
from .clientbound.play import PlayerPositionAndLookPacket
|
||||
from .clientbound.play import DisconnectPacketPlayState
|
||||
from .clientbound.play import SetCompressionPacketPlayState
|
||||
from .clientbound.play import DisconnectPacket as DisconnectPacketPlayState
|
||||
from .clientbound.play import (
|
||||
SetCompressionPacket as SetCompressionPacketPlayState
|
||||
)
|
||||
from .clientbound.play import PlayerListItemPacket
|
||||
from .clientbound.play import MapPacket
|
||||
from .clientbound.play import get_packets as state_playing_clientbound
|
||||
|
@ -23,7 +23,7 @@ def get_packets(context):
|
||||
PlayerPositionAndLookPacket,
|
||||
MapPacket,
|
||||
PlayerListItemPacket,
|
||||
DisconnectPacketPlayState,
|
||||
DisconnectPacket,
|
||||
SpawnPlayerPacket,
|
||||
EntityVelocityPacket,
|
||||
UpdateHealthPacket,
|
||||
@ -35,7 +35,7 @@ def get_packets(context):
|
||||
}
|
||||
if context.protocol_version <= 47:
|
||||
packets |= {
|
||||
SetCompressionPacketPlayState,
|
||||
SetCompressionPacket,
|
||||
}
|
||||
return packets
|
||||
|
||||
@ -82,7 +82,7 @@ class ChatMessagePacket(Packet):
|
||||
{'position': Byte}]
|
||||
|
||||
|
||||
class DisconnectPacketPlayState(Packet):
|
||||
class DisconnectPacket(Packet):
|
||||
@staticmethod
|
||||
def get_id(context):
|
||||
return 0x1A if context.protocol_version >= 332 else \
|
||||
@ -96,7 +96,7 @@ class DisconnectPacketPlayState(Packet):
|
||||
{'json_data': String}]
|
||||
|
||||
|
||||
class SetCompressionPacketPlayState(Packet):
|
||||
class SetCompressionPacket(Packet):
|
||||
# Note: removed between protocol versions 47 and 107.
|
||||
id = 0x46
|
||||
packet_name = "set compression"
|
||||
|
@ -9,7 +9,7 @@ from minecraft.networking.types import (
|
||||
def get_packets(context):
|
||||
packets = {
|
||||
ResponsePacket,
|
||||
PingPacketResponse,
|
||||
PingResponsePacket,
|
||||
}
|
||||
return packets
|
||||
|
||||
@ -21,7 +21,7 @@ class ResponsePacket(Packet):
|
||||
{'json_response': String}]
|
||||
|
||||
|
||||
class PingPacketResponse(Packet):
|
||||
class PingResponsePacket(Packet):
|
||||
id = 0x01
|
||||
packet_name = "ping"
|
||||
definition = [
|
||||
|
Loading…
Reference in New Issue
Block a user