data/chunks.dat isn't saved if the most recent /forceload command failed
If at the time of saving the world, the most recent /forceload add or /forceload remove command failed (e.g. if a data pack does /forceload add to the same chunk periodically), then no changes to any force-loaded chunks are saved at all.
The cause of this is that a single chunk's dirty state overwrites the dirty state of all force-loaded chunks (which are stored in chunks.dat).
Reproduction steps:
/forceload add 0 0
/forceload add 0 0
- Save and restart the world.
/forceload query
→
No force loaded chunks were found in minecraft:overworld
Code analysis (by intsuc):
In net.minecraft.server.level.ServerLevel#setChunkForced, the dirty state of chunks.dat is set to the result of addition/removal of a forced chunk. If the server saves/stops with the dirty state false, forced chunks will not be saved in chunks.dat properly.
2019-02-10, 02:38 PM
2024-07-31, 04:54 PM
27
19
-