Giter Site home page Giter Site logo

funnyboy-roks / mca-parser Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 48 KB

A library for parsing Minecraft's Region files

Home Page: https://crates.io/crates/mca-parser

License: Other

Rust 100.00%
library minecraft minecraft-region rust hacktoberfest

mca-parser's Introduction

mca-parser

A library for parsing Minecraft's Region files

Usage

// 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.");
}

mca-parser's People

Contributors

funnyboy-roks avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

tokinobug

mca-parser's Issues

[Feature Request] Allow parse mca file from std::io::Read

Sometimes we need to parse a mca file that is not stored in filesystem directly(for example, in a zip file), thus we have to copy the file into disk, which is not convenient. I hope to add a function like
parse_mca_reader(src: &mut dyn Read, coord: RegionCoord)
so that we can parse mca file from any source.

Remove `anyhow`

The use of the anyhow crate is not necessary and was a temporary method of handling errors while making the crate. It would be great to remove the anyhow crate in favour of creating an error enum in this crate and using that to return errors instead.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.