diff options
| author | mat <git@matdoes.dev> | 2025-02-23 03:10:21 +0000 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-02-23 03:10:21 +0000 |
| commit | f8130c3c92946d2293634ba4e252d6bc93026c3c (patch) | |
| tree | 08fc6097137d7b4d31b692f4ba993b23acc64eb7 /azalea-protocol | |
| parent | 34f53baf85fb5c7163ec5d71a8ab9d45d3f271b6 (diff) | |
| download | azalea-drasl-f8130c3c92946d2293634ba4e252d6bc93026c3c.tar.xz | |
minor memory usage optimizations
Diffstat (limited to 'azalea-protocol')
| -rwxr-xr-x | azalea-protocol/src/packets/game/c_level_chunk_with_light.rs | 12 |
1 files changed, 10 insertions, 2 deletions
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<u8>, + /// 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<Vec<u8>>, pub block_entities: Vec<BlockEntity>, } |
