aboutsummaryrefslogtreecommitdiff
path: root/azalea-world/src/chunk_storage.rs
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2023-07-23 23:21:08 -0500
committermat <git@matdoes.dev>2023-07-23 23:21:08 -0500
commit22ea8c60fed17e48a591bcbb82808fed55509386 (patch)
treea85be1738270f7fb2a133b20629f2db0464e58f2 /azalea-world/src/chunk_storage.rs
parent15acf1347727b84472e6a8a1c7a4f51cd3163f01 (diff)
downloadazalea-drasl-22ea8c60fed17e48a591bcbb82808fed55509386.tar.xz
fix sometimes not receiving chunks
Diffstat (limited to 'azalea-world/src/chunk_storage.rs')
-rwxr-xr-xazalea-world/src/chunk_storage.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/azalea-world/src/chunk_storage.rs b/azalea-world/src/chunk_storage.rs
index 3c8d3555..d831770c 100755
--- a/azalea-world/src/chunk_storage.rs
+++ b/azalea-world/src/chunk_storage.rs
@@ -53,6 +53,12 @@ pub struct Section {
pub biomes: PalettedContainer,
}
+/// Get the actual stored view distance for the selected view distance. For some
+/// reason Minecraft actually stores an extra 3 chunks.
+pub fn calculate_chunk_storage_range(view_distance: u32) -> u32 {
+ u32::max(view_distance, 2) + 3
+}
+
impl Default for Section {
fn default() -> Self {
Section {