1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use bitfield_struct::bitfield;
use valence_math::DVec3;

use crate::{Decode, Encode, Packet, VarInt};

#[derive(Copy, Clone, PartialEq, Debug, Encode, Decode, Packet)]
pub struct PlayerPositionLookS2c {
    pub position: DVec3,
    pub yaw: f32,
    pub pitch: f32,
    pub flags: PlayerPositionLookFlags,
    pub teleport_id: VarInt,
}

#[bitfield(u8)]
#[derive(PartialEq, Eq, Encode, Decode)]
pub struct PlayerPositionLookFlags {
    pub x: bool,
    pub y: bool,
    pub z: bool,
    pub y_rot: bool,
    pub x_rot: bool,
    #[bits(3)]
    _pad: u8,
}