This commit is contained in:
HaHaWTH 2024-03-25 19:35:01 +08:00
parent 3bf95f6eba
commit 9f6199b8f2
2 changed files with 1 additions and 13 deletions

View File

@ -191,7 +191,7 @@ public class AsynchronousJoin implements AsynchronousProcess {
int blindTimeOut = (registrationTimeout <= 0) ? 99999 : registrationTimeout;
// AuthMeReReloaded start - Fix async potion apply on Folia
bukkitService.runTaskSyncIfFolia(() -> player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, blindTimeOut, 2)));
player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, blindTimeOut, 2));
// AuthMeReReloaded end
}

View File

@ -141,18 +141,6 @@ public class BukkitService implements SettingsDependent {
getScheduler().runTaskAsynchronously(task);
}
/**
* Runs the task synchronously if we are on a Folia server, else runs normally.
* @param task the task to run
*/
public void runTaskSyncIfFolia(Runnable task) {
if (IS_FOLIA) {
runTask(task);
} else {
task.run();
}
}
/**
* <b>Asynchronous tasks should never access any API in Bukkit. Great care
* should be taken to assure the thread-safety of asynchronous tasks.</b>