Pumpkin/pumpkin-protocol/src/client/play/c_update_entity_pos.rs
Alexander Medvedev 03e81a1436 transfer packet id parsing to build time
This also allows now to create custom packets with a custom packet id which is not in the packets.json
2025-01-10 13:42:39 +01:00

25 lines
547 B
Rust

use pumpkin_data::packet::clientbound::PLAY_MOVE_ENTITY_POS;
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)]
pub struct CUpdateEntityPos {
entity_id: VarInt,
delta: Vector3<i16>,
on_ground: bool,
}
impl CUpdateEntityPos {
pub fn new(entity_id: VarInt, delta: Vector3<i16>, on_ground: bool) -> Self {
Self {
entity_id,
delta,
on_ground,
}
}
}