Closed Esper89 closed 1 year ago
Thanks for pointing out these issues and fixing them. Could you add some tests consisting of the cases you outlined in your description?
I've added the test cases.
Thanks, looks good to me.
Released in version 0.2.8
SNBT strings and keys that start with a number (or that start or end with whitespace) need to be quoted to preserve their value and type. Currently, if you run this library's SNBT output back into it's own SNBT parser:
"0"
are converted to integers."1.2.3"
cause an error." foo "
have their leading and trailing whitespace stripped."0"
or"1.2.3"
cause an error." foo "
have their leading and trailing whitespace stripped.I encountered this problem while formatting a
level.dat
file as SNBT and parsing the output—version strings like"1.19.4"
caused parse errors, and the values of game rules likerandomTickSpeed: "3"
were incorrectly converted from strings to integers.This PR fixes these issues.