You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
648 B
Rust
29 lines
648 B
Rust
4 years ago
|
use minecraft_regions_tool::world_folder::WorldFolder;
|
||
|
use std::path::PathBuf;
|
||
|
use structopt::StructOpt;
|
||
|
|
||
|
#[derive(StructOpt, Debug)]
|
||
|
struct Opt {
|
||
|
/// Path to the world folder
|
||
|
#[structopt(parse(from_os_str))]
|
||
|
input: PathBuf,
|
||
|
|
||
|
#[structopt(subcommand)]
|
||
|
sub_command: SubCommand,
|
||
|
}
|
||
|
|
||
|
#[derive(StructOpt, Debug)]
|
||
|
#[structopt()]
|
||
|
enum SubCommand {
|
||
|
/// Return the total number of chunks in the world
|
||
|
Count,
|
||
|
}
|
||
|
|
||
|
fn main() {
|
||
|
let opt: Opt = Opt::from_args();
|
||
|
let world = WorldFolder::new(opt.input);
|
||
|
match opt.sub_command {
|
||
|
SubCommand::Count => println!("Chunk Count: {}", world.count_chunks().unwrap()),
|
||
|
}
|
||
|
}
|