Fix map autosave using server storage - #506
HP-network wants to merge 2 commits into
Conversation
| + | ||
| + private void autoSaveMaps(final ServerLevel world) { | ||
| + final int autoSavePeriod = net.minecraft.server.MinecraftServer.getServer().autosavePeriod; | ||
| + private synchronized void autoSaveMaps() { |
There was a problem hiding this comment.
Addressed in 8e72d12: autoSaveMaps() is now called once from globalTick(long), after all per-world ticks, and the synchronized modifier has been removed.
| + world.moonrise$getChunkTaskScheduler().chunkHolderManager.processTicketUpdates(); // required to eventually process ticket updates | ||
| + | ||
| + this.autoSaveMaps(world); | ||
| + this.autoSaveMaps(); |
There was a problem hiding this comment.
This is being called inside the tick for worlds. This means that this gets called 1 time for every world in the server. This call should be moved OUTSIDE the method for ticking specific worlds global tick
There was a problem hiding this comment.
Addressed in 8e72d12: autoSaveMaps() is now called once from globalTick(long), after all per-world ticks, and the synchronized modifier has been removed.
|
Updated in 8e72d12.
applyAllPatches and folia-server:compileJava both pass. |
|
@Dueris I moved |
Description
Map data uses the server-global SavedDataStorage, but Folia autosave was still saving the per-world storage. Move the interval gate and save call to RegionizedServer so the global map data is persisted once per autosave interval.
Testing
./gradlew applyAllPatches --no-daemon --console=plain./gradlew folia-server:compileJava --no-daemon --console=plainBoth commands pass.