Nobility is a Rust crate for encoding and decoding NBT, which is a format used by Minecraft: Java Edition.
Features:
unsafe
.This library is based on the spec at https://wiki.vg/NBT#Specification.
Missing features:
```rust let mut file = File::open("helloworld.nbt")?; let mut data = vec![]; file.readto_end(&mut data)?; let cursor = std::io::Cursor::new(data);
// Load the document. This step either copies the data (plaintext) // or decompresses it (gzip). let doc = Document::load(cursor)?; // Parses the document. This returns the root tag's name, and the // root tag (always a Compound tag). Both of these are borrowing the // data inside the Document. let (name, root) = doc.parse()?;
println!("name: {}", name.decode()?); println!("{:#?}", root); ```
```rust let mut writer = NbtWriter::new();
let mut root = writer.root("hello world"); root.field("name").string("Bananrama"); // finish() call is required. root.finish();
let result: Vec