mirror of
https://github.com/Pumpkin-MC/Pumpkin.git
synced 2026-08-30 20:14:23 +00:00
Add Use Item packet
This commit is contained in:
@@ -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::*;
|
||||
|
||||
21
pumpkin-protocol/src/server/play/s_use_item.rs
Normal file
21
pumpkin-protocol/src/server/play/s_use_item.rs
Normal 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,
|
||||
}
|
||||
Reference in New Issue
Block a user