Releases: midnightfreddie/nbt2json
Fixed long array when converting from NBT to json
Bugfix for v0.4.0 where long array json output was always [1,2,3...]
Version 0.4.0 with breaking changes
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
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
- 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
- Empty compound tags will now be
[]
in output instead ofnull
. 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
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
- 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
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