MinedMap/src/bin/regiondump.rs
Matthias Schiffer b2d849081d
io/region: allow stopping foreach_chunk early
Errors returned from the callback stop the loop early.
2023-02-26 01:01:37 +01:00

21 lines
374 B
Rust

use std::path::PathBuf;
use anyhow::Result;
use clap::Parser;
#[derive(Debug, Parser)]
struct Args {
/// Filename to dump
file: PathBuf,
}
fn main() -> Result<()> {
let args = Args::parse();
minedmap::io::region::from_file(args.file.as_path())?.foreach_chunk(
|coords, value: fastnbt::Value| {
println!("Chunk {:?}: {:#x?}", coords, value);
Ok(())
},
)
}