Skip to content

Commit

Permalink
Merge pull request #84 from louis-e/region_file_fix
Browse files Browse the repository at this point in the history
Fix region file creation and template writing in create_region function
  • Loading branch information
louis-e authored Nov 2, 2024
2 parents 8aa2f2b + e578e5d commit 7c62da6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/data_processing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ pub fn generate_world(

let mut block_counter: u64 = 0;

println!("Generating ground layer... {}", "[4/5]".bold());
println!("{} Generating ground layer...", "[4/5]".bold());
let ground_pb: ProgressBar = ProgressBar::new(total_blocks);
ground_pb.set_style(
ProgressStyle::default_bar()
Expand Down
4 changes: 3 additions & 1 deletion src/world_editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ impl ChunkToModify {
section.set_block(x, (y & 15).try_into().unwrap(), z, block);
}

fn sections(&self) -> impl Iterator<Item = Section> + use<'_> {
fn sections(&self) -> impl Iterator<Item = Section> + '_ {
self.sections.iter().map(|(y, s)| s.to_section(*y))
}
}
Expand Down Expand Up @@ -252,6 +252,8 @@ impl<'a> WorldEditor<'a> {
let mut region_file = File::options()
.read(true)
.write(true)
.create(true)
.truncate(true)
.open(&out_path)
.expect("Failed to open region file");

Expand Down

0 comments on commit 7c62da6

Please sign in to comment.