Closed ScorNinja closed 3 months ago
The issue is related to syntax errors when trying to load inventories. When a single item has an error, the function returns and all the remaining items in the file are lost.
I'm working on a fork that adds a lost and found file and replaces the conflicting item with a notice. Code to be tested
I have been able to reproduce this behaviour with the Book and Quill (though not with signed books, as those seem to get escaped properly). Thank you for the PR (#11). I like the Lost and Found technique, though I think I'd also like to use a more resilient storage format. I should also include some kind of automatic migration.
I don't have much time today unfortunately, but I'll give it a good look as soon as I can. I do have a bigger rewrite in mind, which should take care of this and the other open issues, but that will take more time, and I think this should be fixed first.
Has it really been three months already? Oh my, sorry about that.
Any kind of change to the storage format would require a migration, so I couldn't really separate this fix and the bigger rewrite without both updates requiring a migration. Data migration isn't exactly super nice, so I went with the larger effort up front. Took a lot longer than I would have liked, though, so sorry you didn't hear anything from me in the meantime.
I've merged #11 after adding and changing a lot. The storage format is now JSON, and the data gets properly escaped, so this issue is fixed. Releases for key Minecraft versions should be ready in one or a few days.
Sometimes when returning to survival dimensions, players lose half of either their enderchest or personal inventories.