8000 Fix Folia implementation (#588) · CommandAPI/CommandAPI@569dc8e · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 569dc8e

Browse files
authored
Fix Folia implementation (#588)
* Fix Folia implementation * oops
1 parent d5cfd84 commit 569dc8e

File tree

1 file changed

+2
-2
lines changed
  • commandapi-platforms/commandapi-bukkit/commandapi-bukkit-core/src/main/java/dev/jorel/commandapi

1 file changed

+2
-2
lines changed

commandapi-platforms/commandapi-bukkit/commandapi-bukkit-core/src/main/java/dev/jorel/commandapi/Schedulers.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ public void scheduleSync(Plugin plugin, Runnable runnable) {
3737

3838
public void scheduleSyncDelayed(Plugin plugin, Runnable runnable, long delay) {
3939
if (paperImplementations.isFoliaPresent()) {
40-
plugin.getServer().getGlobalRegionScheduler().execute(plugin, runnable);
40+
plugin.getServer().getGlobalRegionScheduler().runDelayed(plugin, task -> runnable.run(), delay);
4141
} else {
4242
plugin.getServer().getScheduler().runTaskLater(plugin, runnable, delay);
4343
}
4444
}
4545

4646
public void scheduleAsync(Plugin plugin, Runnable runnable) {
4747
if (paperImplementations.isFoliaPresent()) {
48-
plugin.getServer().getGlobalRegionScheduler().execute(plugin, runnable);
48+
plugin.getServer().getAsyncScheduler().runNow(plugin, task -> runnable.run());
4949
} else {
5050
plugin.getServer().getScheduler().runTaskAsynchronously(plugin, runnable);
5151
}

0 commit comments

Comments
 (0)
0