Sync get future

This commit is contained in:
Daniel Mills committed 2021-07-19 05:40:48 -04:00
1 parent b2630cfb49
commit 126481833b
1 file changed
+9
@@ -208,6 +208,15 @@ public class J {
Bukkit.getScheduler().scheduleSyncDelayedTask(Iris.instance, r);
}
public static CompletableFuture sfut(Runnable r) {
CompletableFuture f = new CompletableFuture();
Bukkit.getScheduler().scheduleSyncDelayedTask(Iris.instance, () -> {
r.run();
f.complete(null);
});
return f;
}
/**
* Queue a sync task
*