From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: MrHua269 Date: Fri, 5 Jun 2026 09:12:20 +0800 Subject: [PATCH] World load/unload APIs diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java index cd5f47f6d7fa15c1533724673b8bc2c75394795b..48e53223ba7edeca5256244480441a56a6657075 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -775,6 +775,17 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi * @throws IllegalStateException when {@link #isTickingWorlds() isTickingWorlds} is true */ public boolean unloadWorld(@NotNull World world, boolean save); + // Luminol start - Async world unloading api + + /** + * Unloads the given world asynchronously + * + * @param world the world to unload + * @param save whether to save the chunks before unloading + * @param callback the callback to accept the result, true if successful, false otherwise + */ + public void unloadWorld(World world, boolean save, java.util.concurrent.CompletableFuture callback); + // Luminol end /** * Gets the world that players respawn in.