- Enum variants can now be serialized by name. (#62 by @Freax13)
-
Fixes a performance regression in array serialization. (#61 by @caelunshun)
-
Fixes an incompatibility with
serde
versions 1.0.119 and later. (#60 by @Iaiao)
-
Compiling with the
preserve_order
feature will use anIndexMap
instead of aHashMap
for compound tags, which preserves insertion order when serializing. (#54 by @samlich) -
Structs can now be explicitly told to serialize as byte/int/long arrays instead of a list under Serde by using
serialize_with
and the newi8_array()
,i32_array()
, andi64_array()
functions. (#51, #52, and #53 by @Schuwi). For example:
#[derive(Serialize)]
struct MyStruct {
#[serde(serialize_with="hematite_nbt::i8_array")]
byte_array: Vec<i8>,
}
-
Blob
now has alen_bytes()
method to compute the expected length when serialized, restoring functionality removed in #36. It turns out to be helpful to know the length when writing NBT payloads into network packets. (#48 by @ejmount) -
Blob
now has aget()
method to get values by name; previously this was only possible via indexing, which would panic if the key was absent. (#44 by @vlakreeh) -
Blob
now implementsDefault::default()
, as suggested by Clippy.
-
The
flate2
dependency has been bumped to enable compilation for WASM. (#56 by @oOBoomberOo) -
The use of various deprecated APIs in the Rust standard library has been fixed, so consumers of this crate will no longer see build warnings. (#49 by @atheriel)
-
UnrepresentableType
will now correctly show the type in the error message, instead of the literal string$type
. (#47 by @caelunshun) -
The benchmark suite has been rewritten to use Criterion, so it should compile with stable Rust. However, it's not clear that the black-box benchmarks are actually working properly at this time.
-
The project now uses and enforces
rustfmt
rules.
-
Strings are now encoded and decoded using Modified UTF-8, matching the behaviour of the vanilla Minecraft client. This should only affect strings with codepoints outside of the Basic Multilingual Plane, which are likely quite rare in the wild. Note that we permissively handle true UTF-8 input, but always write MUTF-8 output. (#39)
-
Serde-based deserialization now supports
TAG_LongArray
. (#41 by @caelunshun) -
Empty lists are now written with
TAG_End
as the list type instead ofTAG_Byte
. This matches the behaviour of the vanilla Minecraft client, although it should not in theory affect well-behaved NBT parsers. -
Fixes Serde-based serialization of empty lists.
-
Updates the project
README
and adds aNEWS
file.
-
Blob::new()
no longer takes a name parameter; useBlob::named()
instead. (#36) -
Implementation details on
Blob
andValue
includingread_header()
,write_header()
, andlen()
are no longer public or have been removed. (#36) -
Value::write()
is nowValue::to_writer()
, matching the rest of the API. Similarly,Blob::(to|from)_(gzip|zlib)
methods now include a(reader|writer)
prefix. (#36) -
The unfinished
macros
module and the associatedNbtFmt
trait have been removed. These are superceded by Serde support. (#25)
-
Support for (de)serializing Rust types (including
Blob
) to NBT using the Serde framework. This is an optional feature but enabled by default. (#24, #30, #31) -
Support for
TAG_LongArray
viaValue::LongArray
. (#28 by @williewillus) -
Improved printing support for
Blob
andValue
and added an example program for printing out NBT files.
- Bumps the
byteorder
dependency to 1.0.0 and makes associated changes.