This commit is contained in:
HaHaWTH
2024-03-28 04:33:36 +08:00
parent 01e46b566a
commit 50219cc4a9
7 changed files with 12 additions and 16 deletions
@@ -1,7 +1,5 @@
package fr.xephi.authme.service;
import com.github.Anon8281.universalScheduler.UniversalRunnable;
import com.github.Anon8281.universalScheduler.scheduling.tasks.MyScheduledTask;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.initialization.SettingsDependent;
import fr.xephi.authme.settings.Settings;
@@ -18,6 +16,7 @@ import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.scheduler.BukkitTask;
import javax.inject.Inject;
@@ -168,7 +167,7 @@ public class BukkitService implements SettingsDependent {
if (useAsyncTasks) {
runTaskAsynchronously(task);
} else {
runTask(task);
task.run();
}
}
@@ -201,7 +200,7 @@ public class BukkitService implements SettingsDependent {
* @throws IllegalArgumentException if task is null
* @throws IllegalStateException if this was already scheduled
*/
public MyScheduledTask runTaskTimerAsynchronously(UniversalRunnable task, long delay, long period) {
public BukkitTask runTaskTimerAsynchronously(BukkitRunnable task, long delay, long period) {
return task.runTaskTimerAsynchronously(authMe, delay, period);
}
@@ -216,7 +215,7 @@ public class BukkitService implements SettingsDependent {
* @throws IllegalArgumentException if plugin is null
* @throws IllegalStateException if this was already scheduled
*/
public MyScheduledTask runTaskTimer(UniversalRunnable task, long delay, long period) {
public BukkitTask runTaskTimer(BukkitRunnable task, long delay, long period) {
return task.runTaskTimer(authMe, delay, period);
}