Skip to content

Releases: midnightfreddie/nbt2json

Fixed long array when converting from NBT to json

06 Sep 21:59
Compare
Choose a tag to compare

Bugfix for v0.4.0 where long array json output was always [1,2,3...]

Version 0.4.0 with breaking changes

03 May 09:17
689fb8f
Compare
Choose a tag to compare

The breaking changes are the JSON encoding of the NBT long tag (64-bit integer) to allow more compatibility for JSON libraries in other languages that may not handle a 64-bit integer in JSON. Only the long values are affected.

Also, the command line utility has removed and changed some parameters.

For everyone:

  • NBT Long values are now stored as valueLeast & valueMost 32-bit unsigned
    integer pairs
    in JSON. This is to prevent conversion issues across various
    languages' JSON libaries, but it will make a little more work if you need to
    modify these values.
  • Optionally you can store long values as strings in JSON which may be more
    convenient depending on the use case
  • Converting from JSON will accept either strings or the valueLeast/valueMost
    pair automatically

For utility executable users:

  • Some parameters have been removed or renamed
    • Since Bedrock is default, all the little-endian parameters are gone
    • --json2nbt, --big, and --pc were removed, but their aliases remain
    • Command line library has been updated to the latest version
    • Added --long-as-string and short alias -l to cause NBT long values
      (64-bit integers) to be numbers-in-strings in the JSON output instead of
      valueLeast & valueMost numbers

For devs:

  • byteOrder arguments are gone from all functions
  • Use UseJavaEncoding() if you need big-endian / Java Edition encoding.
    UseBedrockEncoding() is set by default, but you can call it to switch back if
    you switched to Java previously.
  • Use UseLongAsString() if you want NBT long int64's to be in the JSON as
    strings. UseLongAsUint32Pair() is set by default, but you can call it to
    switch back if you set the string method previously.
  • Go tests are more thorough

Added tests and improved error messages

02 May 19:58
Compare
Choose a tag to compare

This version has no data differences from v.0.3.3. It just has improved error
messaging and Go tests. I wanted to make this release mostly for those who would
use it as a module so they have the new improvements before I make some breaking
changes for the next version.

  • Added Go tests in nbt2json_test.go
  • Corrected mislabeled error messages
  • Added errors for missing "nbt" in json and out-of-range numbers
  • Added input value to error message output
  • Refactored module code to include commmon.go for possibly interesting exports
  • Executable now pulls version and url from the module values in common.go

NBT Long & UUID Fix

28 Apr 22:47
Compare
Choose a tag to compare
  • Merged VADemon's fix for int64s
  • Int64s (NBT "long"s) will now export and import properly; they were previously getting messed up which impacted UUIDs as well
  • However, other languages' JSON libraries may not handle int64s in JSON; this will be addressed in future release

Memories fix and gzip compression

28 Apr 06:41
3a2dba9
Compare
Choose a tag to compare
  • Empty compound tags will now be [] in output instead of null. This should fix converting back to NBT, especially for empty memories in player.dat.
  • Added --gzip / -z option to command to compress output

Handles new NBT tag ID 12, fix for NaN

11 Aug 06:58
a172b63
Compare
Choose a tag to compare

Fixes:

  • Now returns error if JSON conversion fails
  • Handles double/float64 NaN

New feature:

  • Handles new tag type 12 for array of long/int64 (untested)

Major improvements and breaking changes

28 Jan 13:59
4440c17
Compare
Choose a tag to compare
  • Created top-level JSON document to allow helpful fields and versioning
  • Added YAML conversion to/from the generated JSON
  • Added option to pass a comment string to be included in the JSON/YAML output
  • Changed in/out file parameters to prevent overwriting input file due to confusion
  • NBT conversion continues past the first compound tag. Before, the converter was stopping and missing everything past the first compound tag.
  • NBT tag data is always an array now

First Release

27 Jan 19:16
Compare
Choose a tag to compare

These are the command line binaries for nbt2json. Be sure to always have backups of data in case there are conversion problems.

  • NBT to JSON converts NBT-coded data, such as from Minecraft data, into JSON for human or computer manipulation and back again
  • It can input and output from stdin or files
  • Unlike other NBT tools, by default it uses little endian encoding meaning it works with Minecraft Portable Edition data and Windows 10 edition
  • But with --big-endian it can also work with Java/PC-based Minecraft data