Skip to content

Autosave the level data and the global saved data - #512

Closed
lewisgibson wants to merge 2 commits into
PaperMC:ver/26.2.xfrom
lewisgibson:autosave-global-saved-data
Closed

lewisgibson wants to merge 2 commits into
PaperMC:ver/26.2.xfrom
lewisgibson:autosave-global-saved-data

Conversation

@lewisgibson

@lewisgibson lewisgibson commented Oct 1, 2026 •

Copy link
Copy Markdown

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#tickServer that does it needs region == null, but tickServer is only called from TickRegions with a region, so none of it reaches disk except on a clean stop or save-all, and a crash loses everything since the last of those.

Every ticks-per.autosave the global region now saves the global saved data and each world's level data, honouring save-off and each world's noSave. The change is folded into 0001-Region-Threading-Base.patch. It overlaps #506 on the map data, and both touch RegionizedServer, so whichever goes in second needs a small rebase.

Tested on ver/26.2.x with ticks-per.autosave: 200: set the time to 6000, weather rain, set keep_inventory and 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. With save-off nothing is written on either build. /team is 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.

The branch of MinecraftServer#tickServer that did it needs region == null, which never happens. See the patch for details.
@lewisgibson lewisgibson closed this Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant