Add flush parameter to World#save (#12330)

This commit is contained in:
Strokkur24
2025-03-24 00:37:48 +01:00
committed by GitHub
parent 7819df10a4
commit 37b9ca1f90
2 changed files with 13 additions and 7 deletions

View File

@@ -1264,13 +1264,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
// Paper end
@Override
public void save() {
public void save(boolean flush) {
org.spigotmc.AsyncCatcher.catchOp("world save"); // Spigot
this.server.checkSaveState();
boolean oldSave = this.world.noSave;
this.world.noSave = false;
this.world.save(null, false, false);
this.world.save(null, flush, false);
this.world.noSave = oldSave;
}