Crate mca_parser
source ·Expand description
§mca-parser
A library for parsing Minecraft’s Region files
§Usage
This library should be pretty simple to use,
// 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.");
}
Re-exports§
Modules§
- Module which holds much of the data related structs that are not nbt
- Module which contains information about potential errors that may occur while using this crate
- This module contains all structs related to the nbt data in the chunks
Macros§
- Mod into positive, i.e. -1 % 16 == 15
Structs§
- Represents a Dimension in a Minecraft world
- Represents a region file, with methods to access data within it.
- Represents a file which holds a Region
Enums§
- An enum which represents Minecraft’s IDs for a dimension
- A wrapper around
Region
that allows either a reference to be used or a Box over return types.
Traits§
- A trait which represents something that can be parsed into a region and optionally contains information about which region in the world it is.
Functions§
- Create an iterator over the contents of a directory, allowing each region within to be parsed