chunkedge_protocol/packets/play/
respawn_s2c.rs

1use std::borrow::Cow;
2
3use bitfield_struct::bitfield;
4use chunkedge_binary::{Decode, Encode, VarInt};
5use chunkedge_ident::Ident;
6
7use crate::game_mode::OptGameMode;
8use crate::{GameMode, GlobalPos, Packet};
9
10#[derive(Clone, PartialEq, Debug, Encode, Decode, Packet)]
11pub struct RespawnS2c<'a> {
12    pub dimension_type: VarInt,
13    pub dimension_name: Ident<Cow<'a, str>>,
14    pub hashed_seed: u64,
15    pub game_mode: GameMode,
16    pub previous_game_mode: OptGameMode,
17    pub is_debug: bool,
18    pub is_flat: bool,
19    pub last_death_location: Option<GlobalPos<'a>>,
20    pub portal_cooldown: VarInt,
21    pub sea_level: VarInt,
22    pub data_kept: DataKeptFlags,
23}
24#[bitfield(u8)]
25#[derive(PartialEq, Eq, Encode, Decode)]
26pub struct DataKeptFlags {
27    pub keep_attributes: bool,
28    pub keep_metadata: bool,
29    #[bits(6)]
30    _pad: u8,
31}