Skip to content

Commit d919b96

Browse files
authored
Merge pull request feather-rs#453 from koskja/main
Fix chunk loading
2 parents 2039b09 + b314532 commit d919b96

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

feather/base/src/anvil/region.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ fn read_section_into_chunk(section: &mut LevelSection, chunk: &mut Chunk) -> Res
395395

396396
let chunk_section = ChunkSection::new(blocks, light);
397397

398-
chunk.set_section_at_raw(section.y as isize, Some(chunk_section));
398+
chunk.set_section_at(section.y as isize, Some(chunk_section));
399399

400400
Ok(())
401401
}
@@ -420,7 +420,7 @@ fn chunk_to_chunk_root(
420420
.map(|(y, mut section)| {
421421
let palette = convert_palette(&mut section);
422422
LevelSection {
423-
y: y as i8,
423+
y: (y as i8) - 1,
424424
states: section
425425
.blocks()
426426
.data()

feather/base/src/chunk.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -268,11 +268,6 @@ impl Chunk {
268268
self.sections[(y + 1) as usize] = section;
269269
}
270270

271-
/// Directly sets the section at index `y` without offseting it. Useful when loading from region files
272-
pub fn set_section_at_raw(&mut self, y: isize, section: Option<ChunkSection>) {
273-
self.sections[y as usize] = section;
274-
}
275-
276271
/// Gets the sections of this chunk.
277272
pub fn sections(&self) -> &[Option<ChunkSection>] {
278273
&self.sections

0 commit comments

Comments
 (0)