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§

pub use error::Result;
pub use data::*;

Modules§

data
Module which holds much of the data related structs that are not nbt
error
Module which contains information about potential errors that may occur while using this crate
nbt
This module contains all structs related to the nbt data in the chunks

Macros§

positive_mod
Mod into positive, i.e. -1 % 16 == 15

Structs§

Dimension
Represents a Dimension in a Minecraft world
Region
Represents a region file, with methods to access data within it.
RegionFile
Represents a file which holds a Region

Enums§

DimensionID
An enum which represents Minecraft’s IDs for a dimension
RegionRef
A wrapper around Region that allows either a reference to be used or a Box over return types.

Traits§

RegionParser
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§

parse_directory
Create an iterator over the contents of a directory, allowing each region within to be parsed