knbt icon indicating copy to clipboard operation
knbt copied to clipboard

Add extension methods/properties to Kotlin types for creating Nbt versions of a type.

Open Ayfri opened this issue 3 years ago • 0 comments

Some utility methods/properties could be added on kotlin classes to simplify creation of Nbt types. I actually have some methods listed in the examples on some projects and I use them often.

Exemples :

  • "test".nbt to transform a String to a NbtString.
  • true.asNbtByte() to transform a Boolean to a NbtByte.
  • listOf(1, 2, 3).asNbtList() to transform a List of Number to the NbtList version, maybe to the Nbt[Number]Array version when possible.

Ayfri avatar Mar 16 '23 13:03 Ayfri