mirror of
https://github.com/mat-1/azalea.git
synced 2024-09-19 22:52:32 +00:00
634cb8d72c
* start adding azalea-inventory * design more of how inventories are defined * start working on az-inv-macros * inventory macro works * start adding inventory codegen * update some deps * add inventory codegen * manually write inventory menus * put the inventories in Client * start on containersetcontent * inventory menu should hopefully work * checks in containersetcontent * format a comment * move some variant matches * inventory.rs * inventory stuff * more inventory stuff * inventory/container tracking works * start adding interact function * sequence number * start adding HitResultComponent * implement traverse_blocks * start adding clip * add clip function * update_hit_result_component * start trying to fix * fix * make some stuff simpler * clippy * lever * chest * container handle * fix ambiguity * fix some doc tests * move some container stuff from az-client to azalea * clicking container * start implementing simulate_click * keep working on simulate click * implement more of simulate_click this is really boring * inventory fixes * start implementing shift clicking * fix panic in azalea-chat i hope * shift clicking implemented * more inventory stuff * fix items not showing in containers sometimes * fix test * fix all warnings * remove a println --------- Co-authored-by: mat <git@matdoes.dev> |
||
---|---|---|
.. | ||
benches | ||
src | ||
tests | ||
Cargo.toml | ||
README.md |
Azalea NBT
A fast NBT serializer and deserializer.
- Gzip and Zlib compression
- All data is owned for ease-of-use
- Serde support with the
serde
feature.
Examples
use azalea_nbt::{Nbt, NbtCompound};
use std::io::Cursor;
let buf = include_bytes!("../tests/hello_world.nbt");
let tag = Nbt::read(&mut Cursor::new(&buf[..])).unwrap();
assert_eq!(
tag,
Nbt::Compound(NbtCompound::from_iter(vec![(
"hello world".into(),
Nbt::Compound(NbtCompound::from_iter(vec![(
"name".into(),
Nbt::String("Bananrama".into()),
)]))
)]))
);
Benchmarks
At the time of writing, Azalea NBT is the fastest NBT decoder (approximately twice as fast as Graphite NBT, the second fastest) and on-par with the fastest NBT encoders (sometimes the fastest, depending on the data).
You can run the benchmarks to compare against other NBT libraries with cargo bench --bench compare
and the normal benchmarks with cargo bench --bench nbt
.
Note: For best performance, use RUSTFLAGS='-C target-cpu=native'
.