mirror of
https://github.com/ammaraskar/pyCraft.git
synced 2025-02-02 13:01:24 +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
|
# Status State
|
||||||
# ==============
|
# ==============
|
||||||
from .clientbound.status import ResponsePacket
|
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 .clientbound.status import get_packets as state_status_clientbound
|
||||||
from .serverbound.status import RequestPacket
|
from .serverbound.status import RequestPacket
|
||||||
from .serverbound.status import PingPacket
|
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 JoinGamePacket
|
||||||
from .clientbound.play import ChatMessagePacket
|
from .clientbound.play import ChatMessagePacket
|
||||||
from .clientbound.play import PlayerPositionAndLookPacket
|
from .clientbound.play import PlayerPositionAndLookPacket
|
||||||
from .clientbound.play import DisconnectPacketPlayState
|
from .clientbound.play import DisconnectPacket as DisconnectPacketPlayState
|
||||||
from .clientbound.play import SetCompressionPacketPlayState
|
from .clientbound.play import (
|
||||||
|
SetCompressionPacket as SetCompressionPacketPlayState
|
||||||
|
)
|
||||||
from .clientbound.play import PlayerListItemPacket
|
from .clientbound.play import PlayerListItemPacket
|
||||||
from .clientbound.play import MapPacket
|
from .clientbound.play import MapPacket
|
||||||
from .clientbound.play import get_packets as state_playing_clientbound
|
from .clientbound.play import get_packets as state_playing_clientbound
|
||||||
|
@ -23,7 +23,7 @@ def get_packets(context):
|
|||||||
PlayerPositionAndLookPacket,
|
PlayerPositionAndLookPacket,
|
||||||
MapPacket,
|
MapPacket,
|
||||||
PlayerListItemPacket,
|
PlayerListItemPacket,
|
||||||
DisconnectPacketPlayState,
|
DisconnectPacket,
|
||||||
SpawnPlayerPacket,
|
SpawnPlayerPacket,
|
||||||
EntityVelocityPacket,
|
EntityVelocityPacket,
|
||||||
UpdateHealthPacket,
|
UpdateHealthPacket,
|
||||||
@ -35,7 +35,7 @@ def get_packets(context):
|
|||||||
}
|
}
|
||||||
if context.protocol_version <= 47:
|
if context.protocol_version <= 47:
|
||||||
packets |= {
|
packets |= {
|
||||||
SetCompressionPacketPlayState,
|
SetCompressionPacket,
|
||||||
}
|
}
|
||||||
return packets
|
return packets
|
||||||
|
|
||||||
@ -82,7 +82,7 @@ class ChatMessagePacket(Packet):
|
|||||||
{'position': Byte}]
|
{'position': Byte}]
|
||||||
|
|
||||||
|
|
||||||
class DisconnectPacketPlayState(Packet):
|
class DisconnectPacket(Packet):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_id(context):
|
def get_id(context):
|
||||||
return 0x1A if context.protocol_version >= 332 else \
|
return 0x1A if context.protocol_version >= 332 else \
|
||||||
@ -96,7 +96,7 @@ class DisconnectPacketPlayState(Packet):
|
|||||||
{'json_data': String}]
|
{'json_data': String}]
|
||||||
|
|
||||||
|
|
||||||
class SetCompressionPacketPlayState(Packet):
|
class SetCompressionPacket(Packet):
|
||||||
# Note: removed between protocol versions 47 and 107.
|
# Note: removed between protocol versions 47 and 107.
|
||||||
id = 0x46
|
id = 0x46
|
||||||
packet_name = "set compression"
|
packet_name = "set compression"
|
||||||
|
@ -9,7 +9,7 @@ from minecraft.networking.types import (
|
|||||||
def get_packets(context):
|
def get_packets(context):
|
||||||
packets = {
|
packets = {
|
||||||
ResponsePacket,
|
ResponsePacket,
|
||||||
PingPacketResponse,
|
PingResponsePacket,
|
||||||
}
|
}
|
||||||
return packets
|
return packets
|
||||||
|
|
||||||
@ -21,7 +21,7 @@ class ResponsePacket(Packet):
|
|||||||
{'json_response': String}]
|
{'json_response': String}]
|
||||||
|
|
||||||
|
|
||||||
class PingPacketResponse(Packet):
|
class PingResponsePacket(Packet):
|
||||||
id = 0x01
|
id = 0x01
|
||||||
packet_name = "ping"
|
packet_name = "ping"
|
||||||
definition = [
|
definition = [
|
||||||
|
Loading…
Reference in New Issue
Block a user