C4K3 / nbted

Command-line NBT editor
Creative Commons Zero v1.0 Universal
100 stars 8 forks source link

implement LongArray read/write operations (fixes #1) #2

Closed devvmh closed 4 years ago

devvmh commented 4 years ago

NOTE: this commit doesn't work for me. With my specific unreadable NBT file, I still get a different error message:

caused by: failed to fill whole buffer

However, it does remove the previous error I got that said

    caused by: Got unknown type id c trying to read NBT compound
C4K3 commented 4 years ago

Thanks for the PR!

Seems like it should work. Would you mind adding a (failing) test case? Then I'd be happy to help debug why you're getting that error.

devvmh commented 4 years ago

I suspect the file is legitimately corrupted, since I've also seen errors when logging that player in.

But I have no other tools to validate with other than this one so I'm not sure what I'd do to validate the second error. I guess I should update the commit message

devvmh commented 4 years ago

Fascinating, I've applied the changes above, and now I can open the file with a LongArray, but when I close it I get

Unable to parse edited file
    caused by: Unknown tag type LongArray
devvmh commented 4 years ago

OK, had to push one more fix (https://github.com/C4K3/nbted/compare/e12d94625f8a60eb5852374b45031840980a9214..b4cb93d942a615b34275b1102cd0fd27d5294463) and now manual testing works.

Additionally, I've pushed an actual test (https://github.com/C4K3/nbted/compare/b4cb93d942a615b34275b1102cd0fd27d5294463..05fec15e14933b72324136f84b75a46d43bb04c4) asserting that LongArray works as expected. I used the actual contents of the file I was having a problem with - feel free to suggest changes to make it more generic or just change it.

C4K3 commented 4 years ago

Thanks!