Open jamierocks opened 6 years ago
Took me hours to find it, but you have a copy/paste error: case TAG_LONG_ARRAY: length = is.readInt(); long[] longs = new long[length]; for (int i = 0; i < length; i++) { longs[i] = is.readInt(); // <-- HERE } return new LongArrayTag(name, longs);
Lesson learned, I will look if I can improve the error messages when reading ill-formed NBT. "Tag type id " + id + " is unknown!"
is not very helpful if you don't know where the error comes from
Oops. Will correct that, thanks for pointing it out :+1:.
I am really looking forward for this pull request to be merged.
@SebastianCelejewski You'd be better off using a different library.
@SebastianCelejewski @kashike I am trying to maintain this library in my fork. It is not a "hard" fork though, so if you want to use it with Maven you need jitpack.io: https://jitpack.io/#piegamesde/nbt/
But if I see other people are using it, I will try to make a proper release on Maven.
Currently, I've merged the long tag branch and added some library functionality to deal with region files and reading worlds in 1.13.
You'd still be better off using a different library, in my opinion. This one isn't that great at all compared to other libraries around.
I've been using this library for some time for my Minecraft plugins. I discovered problem with arrays of longs when I was upgrading my stuff to 1.13. I manually injected this pull request into my local fork, recompiled successfully, and it works fine. I don't need other library, this is just fine.
@kashike Do you have any suggestion of what to use instead? I only use this one because it's the best one I could find.
I'm a bit biased since I have my own (https://github.com/KyoriPowered/nbt), but you can look through https://github.com/topics/nbt?l=java.
This tag was introduced with MC 1.12.
This should address #9.