From 7d89a4e9bed017b99e3d1b33de8e3d91fbfec854 Mon Sep 17 00:00:00 2001 From: Snowiiii Date: Tue, 20 Aug 2024 14:25:48 +0200 Subject: [PATCH] Add Clientbound Set Block Destroy Stage --- .../src/client/play/c_block_destroy_stage.rs | 20 +++++++++++++++++++ pumpkin-protocol/src/client/play/mod.rs | 6 ++++-- 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 pumpkin-protocol/src/client/play/c_block_destroy_stage.rs diff --git a/pumpkin-protocol/src/client/play/c_block_destroy_stage.rs b/pumpkin-protocol/src/client/play/c_block_destroy_stage.rs new file mode 100644 index 000000000..0b6a1e94d --- /dev/null +++ b/pumpkin-protocol/src/client/play/c_block_destroy_stage.rs @@ -0,0 +1,20 @@ +use pumpkin_macros::packet; +use serde::Serialize; + +use crate::{position::WorldPosition, VarInt}; + +#[derive(Serialize)] +#[packet(0x06)] +pub struct CSetBlockDestroyStage { + entity_id: VarInt, + location: WorldPosition, + destroy_stage: u8, +} + +impl CSetBlockDestroyStage { + pub fn new(entity_id: VarInt, + location: WorldPosition, + destroy_stage: u8) -> Self { + Self { entity_id, location, destroy_stage } + } +} \ No newline at end of file diff --git a/pumpkin-protocol/src/client/play/mod.rs b/pumpkin-protocol/src/client/play/mod.rs index 71504c280..8f38f39bd 100644 --- a/pumpkin-protocol/src/client/play/mod.rs +++ b/pumpkin-protocol/src/client/play/mod.rs @@ -8,7 +8,6 @@ mod c_entity_animation; mod c_entity_metadata; mod c_entity_velocity; mod c_game_event; -mod c_worldevent; mod c_head_rot; mod c_hurt_animation; mod c_login; @@ -29,9 +28,11 @@ mod c_system_chat_message; mod c_update_entitiy_pos_rot; mod c_update_entity_pos; mod c_update_entity_rot; +mod c_worldevent; +mod c_block_destroy_stage; mod player_action; -pub use c_worldevent::*; +pub use c_block_destroy_stage::*; pub use c_actionbar::*; pub use c_block_update::*; pub use c_center_chunk::*; @@ -62,4 +63,5 @@ pub use c_system_chat_message::*; pub use c_update_entitiy_pos_rot::*; pub use c_update_entity_pos::*; pub use c_update_entity_rot::*; +pub use c_worldevent::*; pub use player_action::*;