chunkedge_protocol/packets/play/
client_information_c2s.rs1use bitfield_struct::bitfield;
2use chunkedge_binary::{Bounded, Decode, Encode};
3
4use crate::packets::configuration::client_information_c2s::ParticleMode;
5use crate::Packet;
6
7#[derive(Clone, Debug, Encode, Decode, Packet)]
8pub struct ClientInformationC2s<'a> {
9 pub locale: Bounded<&'a str, 16>,
10 pub view_distance: u8,
11 pub chat_mode: ChatMode,
12 pub chat_colors: bool,
13 pub displayed_skin_parts: DisplayedSkinParts,
14 pub main_arm: MainArm,
15 pub enable_text_filtering: bool,
16 pub allow_server_listings: bool,
17 pub particle_mode: ParticleMode,
18}
19
20#[bitfield(u8)]
21#[derive(PartialEq, Eq, Encode, Decode)]
22pub struct DisplayedSkinParts {
23 pub cape: bool,
24 pub jacket: bool,
25 pub left_sleeve: bool,
26 pub right_sleeve: bool,
27 pub left_pants_leg: bool,
28 pub right_pants_leg: bool,
29 pub hat: bool,
30 _pad: bool,
31}
32
33#[derive(Copy, Clone, PartialEq, Eq, Default, Debug, Encode, Decode)]
34pub enum ChatMode {
35 Enabled,
36 CommandsOnly,
37 #[default]
38 Hidden,
39}
40
41#[derive(Copy, Clone, PartialEq, Eq, Debug, Default, Encode, Decode)]
42pub enum MainArm {
43 Left,
44 #[default]
45 Right,
46}