Skip to content

knbt v0.10.0

Compare
Choose a tag to compare
@BenWoodworth BenWoodworth released this 24 Sep 16:50
· 4 commits to 0.10 since this release
- 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
)