nbt icon indicating copy to clipboard operation
nbt copied to clipboard

Support the long array tag

Open jamierocks opened this issue 6 years ago • 10 comments

This tag was introduced with MC 1.12.

This should address #9.

jamierocks avatar Jun 10 '18 15:06 jamierocks

Coverage Status

Coverage increased (+2.6%) to 16.196% when pulling f0438cde0128d53f426d003f15db0315d9f1374f on jamierocks:feature/long-array into 7a1b6d986e6fbd01862356d47827b8b357349a22 on flow:develop.

coveralls avatar Jun 10 '18 15:06 coveralls

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

piegamesde avatar Aug 17 '18 14:08 piegamesde

Oops. Will correct that, thanks for pointing it out :+1:.

jamierocks avatar Aug 17 '18 14:08 jamierocks

I am really looking forward for this pull request to be merged.

SebastianCelejewski avatar Oct 27 '18 22:10 SebastianCelejewski

@SebastianCelejewski You'd be better off using a different library.

kashike avatar Oct 27 '18 23:10 kashike

@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.

piegamesde avatar Oct 28 '18 09:10 piegamesde

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.

kashike avatar Oct 28 '18 19:10 kashike

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.

SebastianCelejewski avatar Oct 28 '18 20:10 SebastianCelejewski

@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.

piegamesde avatar Oct 29 '18 08:10 piegamesde

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.

kashike avatar Oct 29 '18 17:10 kashike