aboutsummaryrefslogtreecommitdiff
path: root/src/v1_15_2.rs
diff options
context:
space:
mode:
authorJoey Sacchini <joey@sacchini.net>2021-01-01 17:08:56 -0500
committerJoey Sacchini <joey@sacchini.net>2021-01-01 17:08:56 -0500
commitb31b2d344e244baa735b7a144b7f71c056712438 (patch)
tree6c4894e88e9783021d10b9aa4082df0492ca642d /src/v1_15_2.rs
parent44f0ccc9a8863e3d92a4c02e9f3c7dbe6412f244 (diff)
downloadmcproto-rs-b31b2d344e244baa735b7a144b7f71c056712438.tar.gz
mcproto-rs-b31b2d344e244baa735b7a144b7f71c056712438.tar.bz2
mcproto-rs-b31b2d344e244baa735b7a144b7f71c056712438.zip
make the type for 1.15.2 packet smaller (4k+ -> a few hundred bytes)
Diffstat (limited to 'src/v1_15_2.rs')
-rw-r--r--src/v1_15_2.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/v1_15_2.rs b/src/v1_15_2.rs
index fae1cb8..fef7ce0 100644
--- a/src/v1_15_2.rs
+++ b/src/v1_15_2.rs
@@ -2449,7 +2449,7 @@ pub struct ChunkData {
pub position: ChunkPosition<i32>,
pub primary_bit_mask: VarInt,
pub heightmaps: NamedNbtTag,
- pub biomes: Option<[i32; 1024]>,
+ pub biomes: Option<Box<[i32; 1024]>>,
pub data: CountedArray<u8, VarInt>,
pub block_entities: Vec<NamedNbtTag>,
}
@@ -2464,7 +2464,7 @@ impl Serialize for ChunkData {
if full_chunk {
let biomes = self.biomes.as_ref().unwrap();
- for elem in biomes {
+ for elem in biomes.iter() {
to.serialize_other(elem)?;
}
}
@@ -2511,7 +2511,7 @@ impl Deserialize for ChunkData {
position,
primary_bit_mask,
heightmaps,
- biomes,
+ biomes: biomes.map(move |b| Box::new(b)),
data: chunk_data,
block_entities,
}, data)