IzzelAliz / nbt

Java NBT(Named Binary Tag) library.
https://nbt.izzel.io
MIT License
24 stars 0 forks source link

Support JSON based NBT files #1

Open dzikoysk opened 3 years ago

dzikoysk commented 3 years ago

Hey,

It might be a good idea to support JSON format that stores NBT data. There is a couple of available libraries (like minecraft-data) and it could be quite helpful. It is also supported by all of the IDEs and editors, so it also improves the experience during the process of development such a data.

Here is an example file that represents NBT in JSON: https://github.com/PrismarineJS/minecraft-data/blob/master/data/pc/1.16.2/loginPacket.json (the dimension-codec section, it's mixed file`)

Thanks :)

ustc-zzzz commented 3 years ago

Several details to be confirmed:

dzikoysk commented 3 years ago

Thanks for quick response :)

ustc-zzzz commented 3 years ago

Considering that it's not an official standard and it will depend on at least one JSON library, a new repo (depending on this) will be created for this feature. Please wait for our follow-up actions.

dzikoysk commented 3 years ago

I've created a simple mapper from JSON to NBT, so it's not a problem for me. I reported it to just let you know that some people may also find it useful in the future.

Instead of a new repo, you could also consider modularization of this one like this:

nbt-parent/ - parent settings for both modules
  nbt/      - core NBT module
  nbt-json/ - JSON support for NBT module

In most cases it's the best solution for such a projects.