mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-07-02 13:59:07 +02:00
world/layer: return None from top_layer() for empty chunks
Allow ignoring these chunks for the light map as well.
This commit is contained in:
parent
202364bfca
commit
4fd316f3fc
3 changed files with 24 additions and 5 deletions
|
@ -179,6 +179,15 @@ impl<'a> Chunk<'a> {
|
|||
)
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
match self {
|
||||
Chunk::V1_18 { section_map } => section_map.is_empty(),
|
||||
Chunk::V1_13 { section_map, .. } => section_map.is_empty(),
|
||||
Chunk::V0 { section_map, .. } => section_map.is_empty(),
|
||||
Chunk::Empty => true,
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns an interator over the chunk's sections and their Y coordinates
|
||||
pub fn sections(&self) -> SectionIter {
|
||||
use SectionIterInner::*;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue