mirror of
https://github.com/PaperMC/Paper.git
synced 2025-05-19 05:30:23 -07:00
Add flush parameter to World#save (#12330)
This commit is contained in:
parent
7819df10a4
commit
37b9ca1f90
@ -1,9 +1,7 @@
|
||||
package org.bukkit;
|
||||
|
||||
import java.io.File;
|
||||
import io.papermc.paper.raytracing.PositionedRayTraceConfigurationBuilder;
|
||||
import org.bukkit.generator.ChunkGenerator;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
@ -2410,9 +2408,17 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
public BiomeProvider getBiomeProvider();
|
||||
|
||||
/**
|
||||
* Saves world to disk
|
||||
* Saves the world to disk
|
||||
*/
|
||||
public void save();
|
||||
default void save() {
|
||||
save(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the world to disk
|
||||
* @param flush Whether to wait for the chunk writer to finish
|
||||
*/
|
||||
void save(boolean flush);
|
||||
|
||||
/**
|
||||
* Gets a list of all applied {@link BlockPopulator}s for this World
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user