Releases: BenWoodworth/knbt
Releases · BenWoodworth/knbt
knbt v0.11.5
Changes
- Add a
nameRootClasses
configuration option so it's possible to disable the automatic compound nesting behavior for classes/objects- The nesting behavior will eventually be removed due to it being problematic for a number of reasons, but until then, this offers a quick solution for those who have issues with it. (See #29 for details)
knbt v0.11.4
Changes
- Relicensed under LGPL3 (from GPL3)
- Updated supported multiplatform targets
- Dropped the legacy JS target
- Support Linux/Apple ARM targets
- Now properly supports polymorphic serializers
- Added support for builtin polymorphic class serializers
- With a
classDiscriminator
configuration option
- With a
- Added
NbtContentPolymorphicSerializer
- Added
NbtTransformingSerializer
- Added a common
NbtFormatBuilder
interface shared byNbt { ... }
andStringifiedNbt { ... }
Dependencies
- kotlin 1.5.31 -> 1.9.23
- kotlinx.serialization 1.3.0 -> 1.6.3
- okio 2.10.0 -> 3.9.0
- This major version bump doesn't signify a breaking change. See here.
knbt v0.11.3
Fixes
- Fix
NbtTag
values throwing when trying to serialize (#14)
knbt v0.11.2
Fixes
- Fixed incorrect polymorphic check when serializing sealed classes (#12)
knbt v0.11.1
Fixes
- When decoding Stringified NBT, throw
NbtDecodingException
instead ofEOFException
knbt v0.11.0
Changes
- Implemented Stringified NBT deserialization
- Allow
Boolean
values to be serialized- Serialized with
Byte
tags:false = 0b
,true = 1b
- Added
NbtByte(Boolean)
constructor andNbtByte.booleanValue
property - Added
NbtCompoundBuilder.put(name, boolean)
andNbtListBuilder.add(boolean)
functions
- Serialized with
- Added an
nbt
property toNbtEncoder
andNbtDecoder
, so NBT configurations can be used by serializers
Breaking Changes
- Made
NbtException
classes internal (they were accidentally left public)- Use
SerializationException
instead
- Use
knbt v0.10.1
Changes
- Removed APIs deprecated in v0.10.0
knbt v0.10.0
- Important Migration Notice:
The first breaking change won't cause issues until runtime and requires manual migration
Find all root @Serializable classes in your project, and make sure to migrate them accordingly
Changes
- Updated to kotlinx.serialization 1.3.0 and Kotlin 1.5.31
- Changed kotlinx.serialization dependency from
implementation
toapi
- Root classes now serialize nested in a compound tag using their
@SerialName
Breaking Changes
- All root
@Serializable
classes without@NbtRoot
will need to be changed- Root classes are now automatically nested in a compound tag as if they had
@NbtRoot
- To migrate, name the inner class with
@SerialName("name")
and remove the outer class (see below)
- Root classes are now automatically nested in a compound tag as if they had
- Removed
@NbtRoot
in favor of@SerialName
- Made NbtException internal
- Removed
NbtVariant.BigEndian
,.LittleEndian
, and.LittleEndianBase128
in favor of.Java
,.Bedrock
, and.BedrockNetwork
Fixes
- Work around Kotlin-JS bug: KT-43943
Example Root Class Migration
// knbt 0.9
@Serializable
class LevelRoot(
@SerialName("")
val level: Level
)
@Serializable
class Level
val intValue: Int
)
// knbt 0.10
@Serializable
@SerialName("")
class Level(
val intValue: Int
)
knbt v0.9.2
Fixes
- #8 Config option
ignoreUnknownKeys
breaks when there are unknown keys at the end
knbt v0.9.1
Changes
- Removed APIs deprecated in v0.9.0