owengage / fastnbt

Fast serde serializer and deserializer for Minecraft's NBT and Anvil formats
MIT License
186 stars 34 forks source link

Error while parsing - how to investigate? #44

Closed GrizzlT closed 2 years ago

GrizzlT commented 2 years ago

I'm working on a small rust application that should be able to parse schematics from WorldEdit.

The problem I'm experiencing is that whenever I try to parse my file with fastnbt I get an error saying: "Invalid nbt tag value: 31". I have no clue on how to investigate this error. (the file is about 3-7 kb in size) Using an online nbt editor, I see all the tags in the file clearly but still get an error when trying with FastNBT.

Any ideas on how to find the root of the problem?

GrizzlT commented 2 years ago

My lack of experience with nbt made my panic turn into a Github issue.

I hope future developers remember that nbt is supposed to be gzipped when stored to disk. :)

owengage commented 2 years ago

Glad you solved it! It might be worth me detecting the 31 (which happens to be the first byte of a gzip) and giving a descriptive error. I imagine this is a common thing to do, I've certainly done it.

owengage commented 2 years ago

Master will now give a descriptive error in this case. :)