2023-08-18 19:13:43 +02:00
|
|
|
//! Dumps data from a NBT data file in a human-readable format
|
|
|
|
|
|
|
|
#![warn(missing_docs)]
|
|
|
|
#![warn(clippy::missing_docs_in_private_items)]
|
|
|
|
|
2023-01-25 21:41:08 +01:00
|
|
|
use std::path::PathBuf;
|
2023-01-24 20:39:54 +01:00
|
|
|
|
2023-01-25 21:41:08 +01:00
|
|
|
use anyhow::Result;
|
2023-01-24 20:39:54 +01:00
|
|
|
use clap::Parser;
|
|
|
|
|
2023-08-20 17:04:55 +02:00
|
|
|
/// Dump a Minecraft NBT data file in a human-readable format
|
2023-01-24 20:39:54 +01:00
|
|
|
#[derive(Debug, Parser)]
|
2023-08-21 13:19:00 +02:00
|
|
|
#[command(version)]
|
2023-01-24 20:39:54 +01:00
|
|
|
struct Args {
|
|
|
|
/// Filename to dump
|
|
|
|
file: PathBuf,
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() -> Result<()> {
|
|
|
|
let args = Args::parse();
|
|
|
|
|
2023-08-20 16:28:10 +02:00
|
|
|
let value: fastnbt::Value = minedmap_nbt::data::from_file(args.file.as_path())?;
|
2023-01-25 21:41:08 +01:00
|
|
|
println!("{:#x?}", value);
|
2023-01-24 20:39:54 +01:00
|
|
|
|
|
|
|
Ok(())
|
|
|
|
}
|