Skip to content

Commit

Permalink
Merge pull request #453 from koskja/main
Browse files Browse the repository at this point in the history
Fix chunk loading
  • Loading branch information
caelunshun authored Aug 23, 2021
2 parents 2039b09 + b314532 commit d919b96
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
4 changes: 2 additions & 2 deletions feather/base/src/anvil/region.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ fn read_section_into_chunk(section: &mut LevelSection, chunk: &mut Chunk) -> Res

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

chunk.set_section_at_raw(section.y as isize, Some(chunk_section));
chunk.set_section_at(section.y as isize, Some(chunk_section));

Ok(())
}
Expand All @@ -420,7 +420,7 @@ fn chunk_to_chunk_root(
.map(|(y, mut section)| {
let palette = convert_palette(&mut section);
LevelSection {
y: y as i8,
y: (y as i8) - 1,
states: section
.blocks()
.data()
Expand Down
5 changes: 0 additions & 5 deletions feather/base/src/chunk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,11 +268,6 @@ impl Chunk {
self.sections[(y + 1) as usize] = section;
}

/// Directly sets the section at index `y` without offseting it. Useful when loading from region files
pub fn set_section_at_raw(&mut self, y: isize, section: Option<ChunkSection>) {
self.sections[y as usize] = section;
}

/// Gets the sections of this chunk.
pub fn sections(&self) -> &[Option<ChunkSection>] {
&self.sections
Expand Down

0 comments on commit d919b96

Please sign in to comment.