Update patches to latest 1.21.4 #1

Merged
Chaoscaot merged 242 commits from update/1.21.4 into main 2025-04-23 22:27:11 +02:00
2 changed files with 13 additions and 7 deletions
Showing only changes of commit 37b9ca1f90 - Show all commits

View File

@@ -1,9 +1,7 @@
package org.bukkit; package org.bukkit;
import java.io.File;
import io.papermc.paper.raytracing.PositionedRayTraceConfigurationBuilder; import io.papermc.paper.raytracing.PositionedRayTraceConfigurationBuilder;
import org.bukkit.generator.ChunkGenerator; import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.HashMap; import java.util.HashMap;
@@ -2410,9 +2408,17 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
public BiomeProvider getBiomeProvider(); 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 * Gets a list of all applied {@link BlockPopulator}s for this World

View File

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