Handle player teleport packet

This commit is contained in:
2020-12-14 04:27:06 +00:00
parent c49ce127b9
commit b754a4746d
5 changed files with 59 additions and 30 deletions

View File

@@ -330,6 +330,23 @@ class SpawnLivingEntityPacket(Packet):
{'velocity_z': Short},
]
class EntityTeleport(Packet):
# Sent by the server when an entity moves more than 8 blocks
# https://wiki.vg/Protocol#Entity_Teleport
id = 0x56
packet_name = 'entity teleport'
definition = [
{'entity_id': VarInt},
{'x': Double},
{'y': Double},
{'z': Double},
{'yaw': Angle},
{'pitch': Angle},
{'on_ground': Boolean},
]
class EntityPositionRotationPacket(Packet):
# Sent by the server when an entity rotates and moves
# https://wiki.vg/Protocol#Entity_Position_and_Rotation
@@ -374,19 +391,3 @@ class EntityActionPacket(Packet):
{'action_id': VarInt},
{'jump_boost': VarInt},
]
class SpawnPlayerPacket(Packet):
# https://wiki.vg/Protocol#Spawn_Player
id = 0x04
packet_name = 'spawn player'
definition = [
{'entity_id': VarInt},
{'player_uuid': UUID},
{'x': Double},
{'y': Double},
{'z': Double},
{'yaw': Angle},
{'pitch': Angle},
]