diff --git a/src/main.rs b/src/main.rs index fcd588d..50884e3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -126,7 +126,10 @@ impl<'a> RegionProcessor<'a> { data: world::de::Chunk, ) -> Result< Option<( - Box, + ( + Box, + Box, + ), Box, )>, > { @@ -192,7 +195,7 @@ impl<'a> RegionProcessor<'a> { minedmap::io::region::from_file(path)?.foreach_chunk( |chunk_coords, data: world::de::Chunk| { - let Some((processed_chunk, block_light)) = self + let Some(((processed_chunk, _), block_light)) = self .process_chunk(data) .with_context(|| format!("Failed to process chunk {:?}", chunk_coords))? else { diff --git a/src/world/layer.rs b/src/world/layer.rs index 1e5abba..a457191 100644 --- a/src/world/layer.rs +++ b/src/world/layer.rs @@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize}; use super::chunk::{Chunk, SectionIterItem}; use crate::{ - resource::{BlockFlag, BlockType}, + resource::{Biome, BlockFlag, BlockType}, types::*, }; @@ -83,6 +83,7 @@ impl OptionBlockInfoExt for Option { } pub type BlockInfoArray = LayerBlockArray>; +pub type BiomeArray = LayerBlockArray>; pub type BlockLightArray = LayerBlockArray; /// Fills in a [BlockInfoArray] with the information of the chunk's top @@ -92,7 +93,9 @@ pub type BlockLightArray = LayerBlockArray; /// determined as the block that should be visible on the rendered /// map. For water blocks, the height of the first non-water block /// is additionally filled in as the water depth. -pub fn top_layer(chunk: &Chunk) -> Result, Box)>> { +pub fn top_layer( + chunk: &Chunk, +) -> Result, Box), Box)>> { use BLOCKS_PER_CHUNK as N; if chunk.is_empty() { @@ -101,12 +104,13 @@ pub fn top_layer(chunk: &Chunk) -> Result, Box::default(); + let mut block_biomes = Box::::default(); let mut light = Box::::default(); for SectionIterItem { y: section_y, section, - biomes: _, + biomes, block_light, } in chunk.sections().rev() { @@ -133,6 +137,11 @@ pub fn top_layer(chunk: &Chunk) -> Result, Box Result, Box