azalea/azalea-nbt
EightFactorial c57c68ddf8
Add RegistryHolder struct and serde features (#81)
* Make RegistryHolder struct

* Update deps

* Move RegistryHolder to azalea-protocol

* Convert bytes to bools and back

* Rename and shuffle logic

* Move logic into trait, rename methods

* Final touchups

* Ah, merge mistakes

* Add serde support for ResourceLocation

* Reuse structs

* Error when serde skips values in debug mode
Add missing attributes

* Strict_registry feature, require packet feature

* Add test

* Move into packets

* Docs and touchups

* Reword docs

* Move into module inside ClientboundLoginPacket

* Add azalea-nbt serde feature

* remove duplicate comment and type_ -> kind

---------

Co-authored-by: mat <github@matdoes.dev>
2023-03-11 16:00:10 -06:00
..
benches Replace impl Read with Cursor<&[u8]> (#26) 2022-10-07 20:12:36 -05:00
src Add RegistryHolder struct and serde features (#81) 2023-03-11 16:00:10 -06:00
tests Replace impl Read with Cursor<&[u8]> (#26) 2022-10-07 20:12:36 -05:00
Cargo.toml Add RegistryHolder struct and serde features (#81) 2023-03-11 16:00:10 -06:00
README.md have docs for all crates 2023-01-30 22:05:18 +00:00

Azalea NBT

A fast NBT serializer and deserializer.

Examples

use ahash::AHashMap;
use azalea_nbt::Tag;
use std::{io::{Cursor, Read}, fs::File};

let mut file = File::open("tests/hello_world.nbt").unwrap();
let mut buf = vec![];
file.read_to_end(&mut buf).unwrap();
let tag = Tag::read(&mut Cursor::new(&buf[..])).unwrap();
assert_eq!(
    tag,
    Tag::Compound(AHashMap::from_iter(vec![(
        "hello world".to_string(),
        Tag::Compound(AHashMap::from_iter(vec![(
            "name".to_string(),
            Tag::String("Bananrama".to_string()),
        )]))
    )]))
);