owengage/fastnbt ↗
Created Dec 23, 2020 · View the owengage/fastnbt repository page
Fast serde serializer and deserializer for Minecraft's NBT and Anvil formats
Want this for your repo?
Render a free sample of any GitHub repo in seconds.
Contributors
3
Lines of Code
528
From
May 24, 2020
To
Nov 20, 2020
About owengage/fastnbt
FastNBT is a Rust library providing high-performance serialization and deserialization for Minecraft Java Edition's NBT (Named Binary Tag) format using the serde framework. The project actually consists of three related crates: FastNBT for core NBT serialization, FastSNBT for stringified NBT (sNBT) format, and FastAnvil for working with Minecraft's region file format and world data. FastAnvil supports Minecraft versions from 1.13 onwards with partial support for 1.12, and includes features for rendering world maps.
The library enables developers to work with Minecraft world data programmatically in Rust. It provides convenient abstractions like a Value type for unstructured NBT data and an nbt! macro for inline NBT literals. The project includes practical examples demonstrating common tasks like editing world spawn points in level.dat files and reading player inventory data from player.dat files. FastNBT leverages Rust's type system and serde's attribute system, allowing developers to use idiomatic Rust field naming conventions and zero-copy string parsing through lifetimes.
Beyond the core libraries, the project includes fastnbt-tools with an anvil binary for CPU-intensive map rendering of entire worlds. The creator has published an in-browser WebAssembly demo that renders Minecraft maps, with examples including Hermitcraft season eight worlds, showcasing the practical capabilities of the rendering pipeline.