29 lines
1.2 KiB
Diff
29 lines
1.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: MrHua269 <mrhua269@gmail.com>
|
|
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 a8c262064e4058f786c62c333130c4cac0ce4b66..3c92440fbef6e6970cd800e0038a625a775eda9a 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<Boolean> callback);
|
|
+ // Luminol end
|
|
|
|
/**
|
|
* Gets the world that players respawn in.
|