Add Use Item packet

This commit is contained in:
we sell insurance
2024-08-21 08:30:06 -05:00
parent 59a4fe525d
commit 0410ac097c
2 changed files with 23 additions and 0 deletions

View File

@@ -13,6 +13,7 @@ mod s_set_creative_slot;
mod s_set_held_item;
mod s_swing_arm;
mod s_use_item_on;
mod s_use_item;
pub use s_chat_command::*;
pub use s_chat_message::*;
@@ -29,3 +30,4 @@ pub use s_set_creative_slot::*;
pub use s_set_held_item::*;
pub use s_swing_arm::*;
pub use s_use_item_on::*;
pub use s_use_item::*;

View File

@@ -0,0 +1,21 @@
use num_derive::FromPrimitive;
use pumpkin_macros::packet;
use serde::Deserialize;
use crate::VarInt;
#[derive(Deserialize)]
#[packet(0x39)]
pub struct SUseItem {
// 0 for main hand, 1 for off hand
pub hand: VarInt,
pub sequence: VarInt,
pub yaw: f32,
pub pitch: f32,
}
#[derive(FromPrimitive)]
pub enum Hand {
MainHand = 0,
OffHand,
}