Pumpkin/pumpkin-protocol/src/client/play/update_entity_pos_rot.rs
Alexander Medvedev 466d4380cf Some Refactors
2025-02-01 17:53:41 +01:00

35 lines
692 B
Rust

use pumpkin_data::packet::clientbound::PLAY_MOVE_ENTITY_POS_ROT;
use pumpkin_macros::client_packet;
use pumpkin_util::math::vector3::Vector3;
use serde::Serialize;
use crate::VarInt;
#[derive(Serialize)]
#[client_packet(PLAY_MOVE_ENTITY_POS_ROT)]
pub struct CUpdateEntityPosRot {
entity_id: VarInt,
delta: Vector3<i16>,
yaw: u8,
pitch: u8,
on_ground: bool,
}
impl CUpdateEntityPosRot {
pub fn new(
entity_id: VarInt,
delta: Vector3<i16>,
yaw: u8,
pitch: u8,
on_ground: bool,
) -> Self {
Self {
entity_id,
delta,
yaw,
pitch,
on_ground,
}
}
}