| Crates.io | mca-parser |
| lib.rs | mca-parser |
| version | 1.0.2 |
| created_at | 2023-02-11 02:36:32.176347+00 |
| updated_at | 2024-03-08 16:16:08.529732+00 |
| description | A library for parsing Minecraft's region files |
| homepage | https://github.com/funnyboy-roks/mca-parser |
| repository | https://github.com/funnyboy-roks/mca-parser |
| max_upload_size | |
| id | 782301 |
| size | 61,708 |
A library for parsing Minecraft's Region files
// Create a Region from an open file
let mut file = File::open("r.0.0.mca")?;
let region = Region::from_reader(&mut file)?;
// `chunk` is raw chunk data, so we need to parse it
let chunk = region.get_chunk(0, 0)?;
if let Some(chunk) = chunk {
// Parse the raw chunk data into structured NBT format
let parsed = chunk.parse()?;
println!("{:?}", parsed.status);
} else {
// If the chunk is None, it has not been generated
println!("Chunk has not been generated.");
}