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

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

#[derive(Clone, Debug, Encode, Decode, Packet)]
pub struct EntityStatusEffectS2c {
    pub entity_id: VarInt,
    pub effect_id: VarInt, // TODO: effect ID registry.
    pub amplifier: u8,
    pub duration: VarInt,
    pub flags: Flags,
    pub factor_codec: Option<Compound>,
}

#[bitfield(u8)]
#[derive(PartialEq, Eq, Encode, Decode)]
pub struct Flags {
    pub is_ambient: bool,
    pub show_particles: bool,
    pub show_icon: bool,
    #[bits(5)]
    _pad: u8,
}