You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Entities that don't get tracked correctly can end up being saved more than once, with the same UUID. These duplicate entities will be kept by most servers including the singleplayer integrated server, but only the first loaded one will be visible and functional. Tracking issues will always occur so this case should be handled properly.
Suggested fix: if a newly tracked entity has a UUID already seen during the current download, or existing in nearby saved chunks (possibly configurable radius for performance), remove the older entity. Note: this won't fix cases where a world is downloaded multiple times and an entity has moved outside the checked area, but it will fix all cases within the same download and several cases in repeated downloads.
The text was updated successfully, but these errors were encountered:
Thanks for the report. I thought I was already checking for entities with the same UUID when saving, though I'm not entirely sure how I've implemented that (and it's not something I've recently worked on, so the implementation may be incomplete or broken now). I do know that things like saving the world again will cause issues. One other case is if the entity moves -- if it was originally saved in one chunk, but then it moves to another chunk and that chunk is saved, that will cause duplicate entities; this could happen at arbitrary distances (think minecarts on a rail line used by multiple players) and I don't know of a perfect way to fix it other than creating a file that lists positions of all entities (but even that would be problematic since that file wouldn't be updated if entities move in singleplayer).
This isn't a perfect implementation, as it only avoids it for entities that are being kept in memory to eventually be written, not ones that have already been written fully to disk. But it should stop at least one of these cases...
I've added (dd5db96) something to avoid saving the same entity into multiple chunks, though this only works when the chunks haven't yet been written to disk. I haven't done any testing for it yet, but let me know if this helps. It's not a complete solution, since if the chunk has been written, it still can be duplicated (it won't reload old chunks to remove it). But hopefully it'll do something.
Entities that don't get tracked correctly can end up being saved more than once, with the same UUID. These duplicate entities will be kept by most servers including the singleplayer integrated server, but only the first loaded one will be visible and functional. Tracking issues will always occur so this case should be handled properly.
Suggested fix: if a newly tracked entity has a UUID already seen during the current download, or existing in nearby saved chunks (possibly configurable radius for performance), remove the older entity. Note: this won't fix cases where a world is downloaded multiple times and an entity has moved outside the checked area, but it will fix all cases within the same download and several cases in repeated downloads.
The text was updated successfully, but these errors were encountered: