From f8130c3c92946d2293634ba4e252d6bc93026c3c Mon Sep 17 00:00:00 2001 From: mat Date: Sun, 23 Feb 2025 03:10:21 +0000 Subject: minor memory usage optimizations --- azalea-protocol/src/packets/game/c_level_chunk_with_light.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'azalea-protocol/src/packets') diff --git a/azalea-protocol/src/packets/game/c_level_chunk_with_light.rs b/azalea-protocol/src/packets/game/c_level_chunk_with_light.rs index 9166e0eb..43237c3b 100755 --- a/azalea-protocol/src/packets/game/c_level_chunk_with_light.rs +++ b/azalea-protocol/src/packets/game/c_level_chunk_with_light.rs @@ -1,3 +1,5 @@ +use std::sync::Arc; + use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; use simdnbt::owned::Nbt; @@ -16,8 +18,14 @@ pub struct ClientboundLevelChunkWithLight { #[derive(Clone, Debug, AzBuf)] pub struct ClientboundLevelChunkPacketData { pub heightmaps: Nbt, - // we can't parse the data in azalea-protocol because it depends on context from other packets - pub data: Vec, + /// The raw chunk sections. + /// + /// We can't parse the data in azalea-protocol because it depends on context + /// from other packets + /// + /// This is an Arc because it's often very big and we want it to be cheap to + /// clone. + pub data: Arc>, pub block_entities: Vec, } -- cgit v1.2.3