Skip to content

Releases: BenWoodworth/knbt

knbt v0.11.5

08 May 00:12
Compare
Choose a tag to compare

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

27 Mar 18:56
Compare
Choose a tag to compare

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
  • Added NbtContentPolymorphicSerializer
  • Added NbtTransformingSerializer
  • Added a common NbtFormatBuilder interface shared by Nbt { ... } and StringifiedNbt { ... }

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

04 Oct 22:32
Compare
Choose a tag to compare

Fixes

  • Fix NbtTag values throwing when trying to serialize (#14)

knbt v0.11.2

14 Jul 01:06
Compare
Choose a tag to compare

Fixes

  • Fixed incorrect polymorphic check when serializing sealed classes (#12)

knbt v0.11.1

12 Oct 20:52
Compare
Choose a tag to compare

Fixes

  • When decoding Stringified NBT, throw NbtDecodingException instead of EOFException

knbt v0.11.0

04 Oct 04:37
Compare
Choose a tag to compare

Changes

  • Implemented Stringified NBT deserialization
  • Allow Boolean values to be serialized
    • Serialized with Byte tags: false = 0b, true = 1b
    • Added NbtByte(Boolean) constructor and NbtByte.booleanValue property
    • Added NbtCompoundBuilder.put(name, boolean) and NbtListBuilder.add(boolean) functions
  • Added an nbt property to NbtEncoder and NbtDecoder, so NBT configurations can be used by serializers

Breaking Changes

  • Made NbtException classes internal (they were accidentally left public)
    • Use SerializationException instead

knbt v0.10.1

24 Sep 18:14
Compare
Choose a tag to compare

Changes

  • Removed APIs deprecated in v0.10.0

knbt v0.10.0

24 Sep 16:50
Compare
Choose a tag to compare
- 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 to api
  • 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)
  • Removed @NbtRoot in favor of @SerialName
  • Made NbtException internal
  • Removed NbtVariant.BigEndian, .LittleEndian, and .LittleEndianBase128 in favor of .Java, .Bedrock, and .BedrockNetwork

Fixes


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

13 Sep 23:12
Compare
Choose a tag to compare

Fixes

  • #8 Config option ignoreUnknownKeys breaks when there are unknown keys at the end

knbt v0.9.1

13 Sep 05:11
Compare
Choose a tag to compare

Changes

  • Removed APIs deprecated in v0.9.0