PaperMC / PaperMC/Folia

Map autosave regression after maps moved to server-global SavedDataStorage

Open
#505 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: needs triage type: bug
Dominant language
Shell
Stars
4.4k
Forks
623
PR merge metrics
No merged PRs in 30d

Description

Expected behavior

Filled map data should be periodically saved to disk according to ticks-per.autosave, like on Paper.

Observed/Actual behavior

Map data is not saved during normal runtime and is only written during a clean shutdown.

This appears to be a regression of #372.

Current map creation/access uses the server-global storage:

server.getDataStorage()

but Folia's map autosave still calls:

world.getDataStorage().saveMaps();

These are different SavedDataStorage instances, so the periodic autosave scans the wrong storage.

Steps/models to reproduce
  1. Start Folia with:
ticks-per:
  autosave: 6000
  1. Create a new filled map or update an existing one.
  2. Wait longer than 5 minutes.
  3. Check world/data/minecraft/maps/.

The map .dat file is not created or updated during runtime.

  1. Stop the server normally.

The map data is then written during shutdown.

Plugin and Datapack List

None.

Folia version

[13:52:55 INFO]: Checking version, please wait...
[13:52:55 INFO]: This server is running Folia version 26.2-7-ver/26.2.x@14b7fee (2026-08-25T13:29:28Z) (Implementing API version 26.2.build.7-beta)
You are running the latest version

Other

Map autosaving was originally added in 44f4aabe to fix #372.

After map SavedData was moved to MinecraftServer#getDataStorage(), Folia's autosave path continued using world.getDataStorage().

The likely fix is to make map autosaving server-global and call:

MinecraftServer.getServer().getDataStorage().saveMaps();

once per autosave interval instead of once per world.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the autosave path that calls world.getDataStorage().saveMaps() and compare it with map creation through server.getDataStorage(). Reproduce with ticks-per.autosave set to 6000 and inspect world/data/minecraft/maps/. Done means filled map data is written or updated during runtime once per autosave interval, rather than only at shutdown.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.