@@ -55,8 +55,8 @@ public class BukkitService implements SettingsDependent {
5555 *
5656 * @param task Task to be executed
5757 */
58- public int scheduleSyncDelayedTask (Runnable task ) {
59- return Bukkit . getScheduler (). scheduleSyncDelayedTask ( authMe , task );
58+ public void scheduleSyncDelayedTask (Runnable task ) {
59+ runTask ( task );
6060 }
6161
6262 /**
@@ -67,8 +67,8 @@ public int scheduleSyncDelayedTask(Runnable task) {
6767 * @param task Task to be executed
6868 * @param delay Delay in server ticks before executing task
6969 */
70- public int scheduleSyncDelayedTask (Runnable task , long delay ) {
71- return Bukkit . getScheduler (). scheduleSyncDelayedTask ( authMe , task , delay );
70+ public void scheduleSyncDelayedTask (Runnable task , long delay ) {
71+ runTaskLater ( task , delay );
7272 }
7373
7474 /**
@@ -141,8 +141,6 @@ public void runTaskIfFolia(Location location, Runnable task) {
141141 }
142142 }
143143
144-
145-
146144 /**
147145 * Returns a task that will run after the specified number of server
148146 * ticks.
@@ -181,8 +179,12 @@ public void runTaskOptionallyAsync(Runnable task) {
181179 * @throws IllegalArgumentException if plugin is null
182180 * @throws IllegalArgumentException if task is null
183181 */
184- public BukkitTask runTaskAsynchronously (Runnable task ) {
185- return Bukkit .getScheduler ().runTaskAsynchronously (authMe , task );
182+ public void runTaskAsynchronously (Runnable task ) {
183+ if (IS_FOLIA ) {
184+ getScheduler ().runTaskAsynchronously (task );
185+ } else {
186+ Bukkit .getScheduler ().runTaskAsynchronously (authMe , task );
187+ }
186188 }
187189
188190 /**
0 commit comments