Closed zaigie closed 5 months ago
Dear lord that's one of the largest save files I've seen so far.
Looking at the durability mod, it shouldn't produce NaN
durabilities, so that shouldn't be the issue.
So the main issue is with the NaN
float value that's emitted. The ijson
lib that you're using specifically does not support NaNs as they are not part of the JSON spec (https://github.com/ICRAR/ijson/issues/33).
json.dump
has the allow_nan=False
flag to avoid outputting non-conformant float values (NaN, Infinity, and -Infinity), but that would require additional logic to either:
Thank you for your answer, I give up, or performance is important :(
There's a PR up (#114) to emit null
instead of NaN
, haven't had the chance to test it yet, gotta run to work for now.
EDIT: and it's immediately broken oops, will fix it up at some point
This is a dedicated server archieve file, and added
durability*5
MOD in this server.It can write to Level.sav.json normally, but an error is reported when another tool parses it.
uses ijson to stream parse files:
This looks like a problem caused by server cheating, is there a way to catch exceptions.
The archive is larger than 25M, so I uploaded it here: https://share.zaigie.com/s/U5ODI3N