Querz / NBT

A java implementation of the NBT protocol, including a way to implement custom tags.
MIT License
182 stars 48 forks source link

Strings with the literal values "true" and "false" are mistaken with bytes when written and parsed from SNBT. #63

Open Igrium opened 3 years ago

Igrium commented 3 years ago

If you have a string tag with the value "true" or "false" and you write it to SNBT, it's read as a byte when parsed again. This is problematic when trying to manipulate gamerules using SNBT. Potential fix is to check if a string matches "true" or "false" when writing to SNBT and surround it with quotes if it does.

DalekCraft2 commented 3 years ago

Bumping this, because I also experience this. At the moment, I have to use a custom static method to convert bytes into strings, but it would be safer if the issue was fixed at the source.