mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-07-11 09:39:06 +02:00
resource, world: implement fallback to plains for unknown biomes
Closes #63
This commit is contained in:
parent
d7fc95c950
commit
a10151a4f3
5 changed files with 37 additions and 18 deletions
|
@ -97,14 +97,14 @@ impl LayerEntry<'_> {
|
|||
|
||||
if self.is_empty() {
|
||||
*self.block = Some(block_type.block_color);
|
||||
if let Some(biome) = section.biomes.biome_at(section.y, coords)? {
|
||||
let (biome_index, _) = biome_list.insert_full(*biome);
|
||||
*self.biome = NonZeroU16::new(
|
||||
(biome_index + 1)
|
||||
.try_into()
|
||||
.expect("biome index not in range"),
|
||||
);
|
||||
}
|
||||
|
||||
let biome = section.biomes.biome_at(section.y, coords)?;
|
||||
let (biome_index, _) = biome_list.insert_full(*biome);
|
||||
*self.biome = NonZeroU16::new(
|
||||
(biome_index + 1)
|
||||
.try_into()
|
||||
.expect("biome index not in range"),
|
||||
);
|
||||
}
|
||||
|
||||
if block_type.block_color.is(BlockFlag::Water) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue