From 0b84e1cbb826f1a502ffc81efc000369a3c5bb85 Mon Sep 17 00:00:00 2001 From: mat Date: Sat, 7 May 2022 18:47:16 -0500 Subject: add a couple more packets --- .../src/packets/game/clientbound_set_experience_packet.rs | 10 ++++++++++ .../src/packets/game/clientbound_teleport_entity_packet.rs | 13 +++++++++++++ azalea-protocol/src/packets/game/mod.rs | 4 ++++ 3 files changed, 27 insertions(+) create mode 100644 azalea-protocol/src/packets/game/clientbound_set_experience_packet.rs create mode 100644 azalea-protocol/src/packets/game/clientbound_teleport_entity_packet.rs (limited to 'azalea-protocol/src/packets') diff --git a/azalea-protocol/src/packets/game/clientbound_set_experience_packet.rs b/azalea-protocol/src/packets/game/clientbound_set_experience_packet.rs new file mode 100644 index 00000000..88c306dc --- /dev/null +++ b/azalea-protocol/src/packets/game/clientbound_set_experience_packet.rs @@ -0,0 +1,10 @@ +use packet_macros::GamePacket; + +#[derive(Clone, Debug, GamePacket)] +pub struct ClientboundSetExperiencePacket { + pub experience_progress: f32, + #[var] + pub experience_level: u32, + #[var] + pub total_experience: u32, +} diff --git a/azalea-protocol/src/packets/game/clientbound_teleport_entity_packet.rs b/azalea-protocol/src/packets/game/clientbound_teleport_entity_packet.rs new file mode 100644 index 00000000..ea8788d6 --- /dev/null +++ b/azalea-protocol/src/packets/game/clientbound_teleport_entity_packet.rs @@ -0,0 +1,13 @@ +use packet_macros::GamePacket; + +#[derive(Clone, Debug, GamePacket)] +pub struct ClientboundTeleportEntityPacket { + #[var] + pub id: u32, + pub x: f64, + pub y: f64, + pub z: f64, + pub y_rot: i8, + pub x_rot: i8, + pub on_ground: bool, +} diff --git a/azalea-protocol/src/packets/game/mod.rs b/azalea-protocol/src/packets/game/mod.rs index 776c5d41..d3ea7281 100755 --- a/azalea-protocol/src/packets/game/mod.rs +++ b/azalea-protocol/src/packets/game/mod.rs @@ -21,8 +21,10 @@ pub mod clientbound_set_chunk_cache_center; pub mod clientbound_set_default_spawn_position_packet; pub mod clientbound_set_entity_data_packet; pub mod clientbound_set_entity_link_packet; +pub mod clientbound_set_experience_packet; pub mod clientbound_set_health_packet; pub mod clientbound_set_time_packet; +pub mod clientbound_teleport_entity_packet; pub mod clientbound_update_attributes_packet; pub mod clientbound_update_recipes_packet; pub mod clientbound_update_tags_packet; @@ -61,8 +63,10 @@ declare_state_packets!( 0x4d: clientbound_set_entity_data_packet::ClientboundSetEntityDataPacket, 0x45: clientbound_set_entity_link_packet::ClientboundSetEntityLinkPacket, 0x4f: clientbound_entity_velocity_packet::ClientboundEntityVelocityPacket, + 0x51: clientbound_set_experience_packet::ClientboundSetExperiencePacket, 0x52: clientbound_set_health_packet::ClientboundSetHealthPacket, 0x59: clientbound_set_time_packet::ClientboundSetTimePacket, + 0x62: clientbound_teleport_entity_packet::ClientboundTeleportEntityPacket, 0x64: clientbound_update_attributes_packet::ClientboundUpdateAttributesPacket, 0x66: clientbound_update_recipes_packet::ClientboundUpdateRecipesPacket, 0x67: clientbound_update_tags_packet::ClientboundUpdateTagsPacket, -- cgit v1.2.3