"Time Travel" recovery, E.G. entities (crops, saplings, animals) with negative time (region file only recovery as example)
mjevans opened this issue ยท 6 comments
This enhancement request is more "tools and defaults to handle invalid data".
The particular use case is from the TFC Tusday server's post-virus recovery, where they only had recoverable region files and zero player or world data files. Due to the way entities store their data as absolute world timestamps; recovering the proper world time-stamp to set using /timetfc is nearly impossible without sampling the NBT of plants, trees, and animals to deduce a range of probable values.
A far easier solution for the average user would be, on chunk-load, to validate the time-delta of any entity using that value and if it's obviously wrong (E.G. negative values) to clamp that back to a default value that's valid for the current time. Any plant should reset time to having just updated to the present growth stage as having just happened (and set a new next update based on that value, maybe with a small RNG range added). Animals that grow should also have their ages reset in a similar way.
As mentioned in a different thread, some kind of debug tool would be useful for specific cases. However this enhancement would mostly compliment that fix, by having a general solution and data-validation check on chunk loading.
While this is, in theory, useful - we can't do this for the same reason we have spent zero effort implementing data fixers for world upgrading between 1.12 and 1.16. Mojang can do this as they're a company with much more time and money than we have, and as a result, the argument
So, if you introduce these mechanics into vanilla you should take care of them, even fix them if it's needed.
just doesn't hold water. This is not something we're ever likely to be able to invest time into, nor is it a priority.
The related issue (single / local entity case commands / debug wand) is #890
If your server has nothing recoverable other than region files the would should be considered corrupted and replaced.
You don't know what else is wrong with it and thus why taking backups is advised by anyone when dealing with worlds that are important.
This falls to poor server management, not a mod problem.
Open a region file and get a timestamp and set it to that if you want to keep the world. Add more time if it's not enough.
There are tons of things that are tied to time, you can't just "fix" one or some. This isn't a "easy" task at all.
It is understandable that someone, and particularly a large group of users, would be reluctant to throw away tens to hundreds of hours of progression when their world still exists, but the synchronization data and player files don't.
A more general use case that was mentioned in Pakratt0013's twitch chat by someone else was the restoration of some chunks post-griefing, though thinking about that after the fact anything restored that way would be anachronistic relative to the rest of the world and 'too old' rather than timestamps from the world's future.
Also, the latter suggestion isn't an option anymore either; another 8 hours has been added on top of that world and new elements added with the old timestamp. A method of enforcing world consistency as a whole to synchronize the times would be another method; but THAT actually sounds hard. Adding a validation step to newly instantiated entities would provide the least impact and improve robustness.
Yes, it is understandable but if something was that important you should be keeping copies of it. There isn't any amount of safety or conversion that can be done to prevent file level destruction. Not even vanilla minecraft handles this.
If you roll back a chunk via another mod that saves changes everything will have old dates on it because time moves forward. So everything will act as they should within the time period passed. Deleting a chunk to regenerate it will have no effect as everything will be created again with current a date and work as expected. There is no use case here, it's impossible for world time to move backwards in any way other than the data being removed or commands and it's easily reversed by adding/setting time.
That sucks, could have easily asked in discord or waited for a reply to the issue before continuing on. Especially with an issue this bad and where guidance would be required. If you have a bunch of animals that are messed up just spawn new ones or use the /entitydata
command to fix the nbt tags to whatever you want them to be. Anything automated isn't going to know what you want done either.
I partially agree with both of you. Losing backups not necessarily mean poor server management. It happens if you renting a gaming server and backup stores with the instance and you download it only once a day or more rarely (currently there is no Minecraft backup mod that supports handling offsite backups). So it's totally understandable point that he wants to recover the world, especially with TFC where the progression could be much slower than in other primitive-type mods.
However this is exactly why you should take care about the world's data if you operate a server. Backup mods, regular syncing - this is not 2013 when there was almost no mod that could implement backup in-game only bukkit plugins.
From the other side, if the only "fix" is blindly deleting and regenerating "corrupted" chunks, it could be annoying for an end-user.
It's true that vanilla itself does not contain a fix for time going backward - but you should also add that vanilla does not have any mechanics that tied this strictly to the time. Plants grow in full "year" and never die just because of the time, animals are same. Food items are not decay. So, if you introduce these mechanics into vanilla you should take care of them, even fix them if it's needed.