chunkedge_protocol/packets/play/
player_input_c2s.rs

1use bitfield_struct::bitfield;
2use chunkedge_binary::{Decode, Encode};
3
4use crate::Packet;
5
6#[derive(Copy, Clone, Debug, Encode, Decode, Packet)]
7pub struct PlayerInputC2s {
8    pub flags: PlayerInputFlags,
9}
10
11#[bitfield(u8)]
12#[derive(PartialEq, Eq, Encode, Decode)]
13pub struct PlayerInputFlags {
14    pub forward: bool,
15    pub back: bool,
16    pub left: bool,
17    pub right: bool,
18    pub jump: bool,
19    pub sneak: bool,
20    pub sprint: bool,
21    #[bits(1)]
22    _padding: u8,
23}