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