Serde deriving
- Tagged enums not supported
- Untagged enums: the default implementation of
Deserializederived by serde macros does some crazy stuff with types, so if you have multiple variants with differrent "flavors" of the same base type (integers: byte, short, int, long, or lists: list, byte array, int array, long array) serde will automatically convert it the value that is first defined in the enum. For example:
Using the code above, even if you encounter a value that is encoded as aLongin NBT, serde will still always give youExample::First, except for when the number is big enough that it can't fit in au32. This is very inconsistent and therefore if you need this functionality, consider implementingDeserializemanually. See the implementation ofDynNBTfor an example. - Option: if serialized/deserialized standalone, will write/read a
Tag::Endbyte. However, if inside a compound, will be skipped altogether.