feat: skip saving worlds on shutdown when autosave is disabled#13999
Open
DartCZ wants to merge 1 commit into
Open
feat: skip saving worlds on shutdown when autosave is disabled#13999DartCZ wants to merge 1 commit into
DartCZ wants to merge 1 commit into
Conversation
Member
|
Disabling autosaving should not disable world saving entirely |
Author
Agree and to clarify, this PR doesn't disable world saving entirely.
|
Toffikk
suggested changes
Jun 28, 2026
Toffikk
left a comment
Contributor
There was a problem hiding this comment.
these changes should be merged into source/respective patches
7d10f66 to
09ce1eb
Compare
Author
Done ✅ |
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.
Summary
Respect the
ticks-per.autosavesetting on server shutdown. When autosave isdisabled (
ticks-per.autosave <= 0), Paper no longer writes world chunks todisk during
stopServer()it only closes the chunk system cleanly. Whenautosave is enabled (
> 0), behaviour is unchanged: worlds are saved on stopexactly as before.
Motivation
Currently
ticks-per.autosave <= 0disables periodic autosaving, but theserver still performs a full world save on shutdown, so the setting does not
actually guarantee a non-persistent world.
This is most useful for minigame / lobby servers whose main world is meant
to be ephemeral: the map is reset from a template on every boot, so persisting
player-made changes on shutdown is undesirable (and a waste of disk I/O on large
voided worlds). With this change, setting
ticks-per.autosaveto0/-1makesthe world truly read-only across restarts, without resorting to plugins that
force-unload or wipe regions.
The boundary (
> 0saves,<= 0skips) matches the existing convention alreadyused elsewhere in the server:
MinecraftServer#tickServer-fullSave = this.autosavePeriod > 0 && ...CraftServer#checkSaveState- treatsautosavePeriod <= 0as disabled.Scope / notes
level.dat,scoreboard, saved data via
saveGlobalData) and player data are still savedon stop, as before. Gating those is intentionally out of scope. (Extra option for this in the future?)
while (false && ...)block left over from thechunk-system rewrite, since the surrounding code was already being touched.