Skip to content

Fix player autosave#459

Open
Dueris wants to merge 1 commit into
PaperMC:ver/26.1.xfrom
Dueris:fix/player-autosave
Open

Fix player autosave#459
Dueris wants to merge 1 commit into
PaperMC:ver/26.1.xfrom
Dueris:fix/player-autosave

Conversation

@Dueris

@Dueris Dueris commented Jun 1, 2026

Copy link
Copy Markdown

Folia forgets to set the lastSave long field on join of a player, making it so that Folia doesn't ever run autosave on players unless saved manually, of which after a manual save, autosave starts because in Playerlist#save(Lnet/minecraft/server/level/ServerPlayer;), the long field, lastSave is set. By setting this on join to System.nanoTime() and checking for the LAST_SAVE_ABSENT value during autosave, this fixes players not being autosaved

Original:
https://github.com/CraftCanvasMC/Canvas/blob/00b4aed9f9a2c17300a9603827075b761962787d/canvas-server/minecraft-patches/base/0008-Fixup-Region-Threading.patch#L3954
CraftCanvasMC/Canvas#210

@R00tB33rMan R00tB33rMan left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@Euphillya

Copy link
Copy Markdown
Contributor

This PR fixes a critical bug in the game that can cause a rollback (very important) after a crash (I've already experienced this). I strongly advise merging it as soon as possible

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.

3 participants