mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-07-11 09:39:06 +02:00
world: introduce SectionIterItem struct
This commit is contained in:
parent
ed422be451
commit
47dc3795a3
3 changed files with 24 additions and 14 deletions
|
@ -1,7 +1,7 @@
|
|||
use anyhow::{Context, Result};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use super::chunk::Chunk;
|
||||
use super::chunk::{Chunk, SectionIterItem};
|
||||
use crate::{
|
||||
resource::{BlockFlag, BlockType},
|
||||
types::*,
|
||||
|
@ -97,7 +97,11 @@ pub fn top_layer(chunk: &Chunk) -> Result<Box<BlockInfoArray>> {
|
|||
let mut done = 0;
|
||||
let mut ret = Box::<BlockInfoArray>::default();
|
||||
|
||||
for (section_y, section) in chunk.sections().rev() {
|
||||
for SectionIterItem {
|
||||
y: section_y,
|
||||
section,
|
||||
} in chunk.sections().rev()
|
||||
{
|
||||
for y in BlockY::iter().rev() {
|
||||
for xz in BlockInfoArray::keys() {
|
||||
let entry = &mut ret[xz];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue