Repository navigation
Autosave the level data and the global saved data - #512
Closed
lewisgibson wants to merge 2 commits into
Closed
lewisgibson wants to merge 2 commits into
lewisgibson wants to merge 2 commits into
Conversation
The branch of MinecraftServer#tickServer that did it needs region == null, which never happens. See the patch for details.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Server-wide and per-world saved data is never autosaved on Folia: the clock and weather, game rules, scoreboard, world border, raids, the dragon fight, forced chunks, the map data and each world's level.dat. The branch of
MinecraftServer#tickServerthat does it needsregion == null, buttickServeris only called fromTickRegionswith a region, so none of it reaches disk except on a clean stop orsave-all, and a crash loses everything since the last of those.Every
ticks-per.autosavethe global region now saves the global saved data and each world's level data, honouringsave-offand each world'snoSave. The change is folded into0001-Region-Threading-Base.patch. It overlaps #506 on the map data, and both touchRegionizedServer, so whichever goes in second needs a small rebase.Tested on
ver/26.2.xwithticks-per.autosave: 200: set the time to 6000,weather rain, setkeep_inventoryand use a map, wait for one autosave plus 15 seconds,kill -9, then read the files. Unpatched, no .dat file changed during the wait and after the kill the weather, game rule, clock and map data were all missing or at their defaults. With this change they are all on disk. Withsave-offnothing is written on either build./teamis disabled on 26.2.x, so the scoreboard file was not part of the test.This was done with AI (Claude Opus 5.5 and GPT Astra, high effort). I've reviewed it and tested it myself.