Open Fisch37 opened 2 months ago
The fix for this is trivial. Some light testing shows the following fix works fine:
Alter line 352 of SharpNBT.SNBT.StringNbt from
if (char.IsNumber(c) || c == ',')
to
if (char.IsNumber(c) || c == '-' || c == ',')
Well, that is an embarrassing oversight on my part, no clue how I let that happen....
I don't have the code on my current machine to test with, but the fix would likely also require and additional check to ensure the -
is the first character, and not just anywhere within the string (e.g. -123
is valid, but 1-2-3-
is not). Either way, it will be a trivial fix to implement, thank you for taking the time to report.
the fix would likely also require and additional check to ensure the - is the first character, and not just anywhere within the string
That's true! Good catch! Thanks to you for taking the time to develop this thing! (Like seriously, I think this is the only SNBT parser library for C#)
Title...
Attempting to parse an integer array fails with a SyntaxError if the array contains a negative number. This effectively means that any SNBT containing a UUID fails as those are length 4 Integer Arrays and UUID format guarantees a negative number here.
A simple check to confirm:
throws