SpongePowered / nbt

Named Binary Tag (NBT) library for Java based on Graham Edgecombe's JNBT library. NBT is a tag based binary format designed to carry large amounts of binary data with smaller amounts of additional data.
https://flow.github.io/nbt
MIT License
50 stars 33 forks source link

ShortArrayTag? #9

Closed piegamesde closed 6 years ago

piegamesde commented 6 years ago

The TagType class defines:

TAG_COMPOUND(CompoundTag.class, "TAG_Compound", 10),
TAG_INT_ARRAY(IntArrayTag.class, "TAG_Int_Array", 11),
TAG_SHORT_ARRAY(ShortArrayTag.class, "TAG_Short_Array", 100),;

What is a "short array"? The inofficial documentation I found (Minecraft wiki in different languages as well as wiki.vg) has no short array. Instead, there should be a long array with ID 12. And why does it have ID 100?

I haven't looked at the original Minecraft source code though.

jamierocks commented 6 years ago

https://github.com/flow/nbt/commit/8800cf36667ac43ef34328c7ee5fc5dd377b31c7#commitcomment-1128655 should explain.

piegamesde commented 6 years ago

Thanks for this, but this does not explain why there isn't a long array tag. Don't we need one if Minecraft specifies one?

jamierocks commented 6 years ago

LongArrayTag looks to have been introduced with MC 1.12, so fairly recently. I'll writeup a PR to address this.

piegamesde commented 6 years ago

If you're there, please add a comment into the code indicating that the ShortArrayTag is not part of the official file format. It may confuse users or even break things when used inappropriately.