chunkedge_protocol/packets/play/
player_position_s2c.rs

1use bitfield_struct::bitfield;
2use chunkedge_binary::{Decode, Encode, VarInt};
3use chunkedge_math::DVec3;
4
5use crate::Packet;
6#[derive(Copy, Clone, PartialEq, Debug, Encode, Decode, Packet)]
7pub struct PlayerPositionS2c {
8    pub teleport_id: VarInt,
9    pub position: DVec3,
10    pub velocity: DVec3,
11    pub yaw: f32,
12    pub pitch: f32,
13    pub flags: TeleportRelativeFlags,
14}
15
16#[bitfield(u32)]
17#[derive(PartialEq, Eq, Encode, Decode)]
18pub struct TeleportRelativeFlags {
19    pub x: bool,
20    pub y: bool,
21    pub z: bool,
22    pub y_rot: bool,
23    pub x_rot: bool,
24    pub x_vel: bool,
25    pub y_vel: bool,
26    pub z_vel: bool,
27    pub rot_vel: bool,
28    #[bits(23)]
29    _pad: u32,
30}