azalea_protocol/packets/game/
c_level_chunk_with_light.rs

1use std::sync::Arc;
2
3use azalea_buf::AzBuf;
4use azalea_protocol_macros::ClientboundGamePacket;
5use azalea_registry::builtin::BlockEntityKind;
6use azalea_world::heightmap::HeightmapKind;
7use simdnbt::owned::Nbt;
8
9use super::c_light_update::ClientboundLightUpdatePacketData;
10
11#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)]
12pub struct ClientboundLevelChunkWithLight {
13    // this can't be a ChunkPos since that reads z first and then x
14    pub x: i32,
15    pub z: i32,
16    pub chunk_data: ClientboundLevelChunkPacketData,
17    pub light_data: ClientboundLightUpdatePacketData,
18}
19
20#[derive(Clone, Debug, AzBuf, PartialEq)]
21pub struct ClientboundLevelChunkPacketData {
22    pub heightmaps: Vec<(HeightmapKind, Box<[u64]>)>,
23    /// The raw chunk sections.
24    ///
25    /// We can't parse the data in azalea-protocol because it depends on context
26    /// from other packets
27    ///
28    /// This is an Arc because it's often very big and we want it to be cheap to
29    /// clone.
30    pub data: Arc<Box<[u8]>>,
31    pub block_entities: Vec<BlockEntity>,
32}
33
34#[derive(Clone, Debug, AzBuf, PartialEq)]
35pub struct BlockEntity {
36    pub packed_xz: u8,
37    pub y: u16,
38    pub kind: BlockEntityKind,
39    pub data: Nbt,
40}