aboutsummaryrefslogtreecommitdiff
path: root/azalea-protocol/src/packets
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-02-23 03:10:21 +0000
committermat <git@matdoes.dev>2025-02-23 03:10:21 +0000
commitf8130c3c92946d2293634ba4e252d6bc93026c3c (patch)
tree08fc6097137d7b4d31b692f4ba993b23acc64eb7 /azalea-protocol/src/packets
parent34f53baf85fb5c7163ec5d71a8ab9d45d3f271b6 (diff)
downloadazalea-drasl-f8130c3c92946d2293634ba4e252d6bc93026c3c.tar.xz
minor memory usage optimizations
Diffstat (limited to 'azalea-protocol/src/packets')
-rwxr-xr-xazalea-protocol/src/packets/game/c_level_chunk_with_light.rs12
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>,
}