Offroaders123 / NBTify

A library to read and write NBT files on the web!
http://npm.im/nbtify
MIT License
42 stars 5 forks source link

Root ListTag - Bedrock #23

Closed Offroaders123 closed 1 year ago

Offroaders123 commented 1 year ago

Investigate Bedrock's use of having the ListTag type as the root element, as it appears to not always be the CompoundTag type.

NBT format - Minecraft Wiki

Offroaders123 commented 1 year ago

Starting to look into this one, now that I have the types for things set up a bit fancier. Having tests now are going to help a bunch with this too, as it can help ensure that adding this doesn't break the rest of the format implementations.

Root TAG_List Support
Offroaders123 commented 1 year ago

Got everything working! Going to continue testing that this is indeed fully supported, implementation-wise, then I will close this issue out.

In the previous commit, I added SNBT writing support for this, which completed making the symmetrical file testing pass! So you can safely go from TAG_List-rooted NBT data, to a CompoundTag object, down to an SNBT string, back to a CompoundTag object, and finally down to binary NBT data again. Super cool.