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 ac19fd1b6b8e48313c79d9fb26c3df50f67b64b8..c037307f926d64bac3b51a91aa61f63d0357770c 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.