Virtual Threads for database caching

This commit is contained in:
HaHaWTH
2024-03-28 15:21:22 +08:00
parent a93f0546e3
commit 6a96d993e1
3 changed files with 43 additions and 11 deletions
@@ -98,11 +98,19 @@ public class BukkitService implements SettingsDependent {
* @throws IllegalArgumentException if task is null
*/
public void runTask(Runnable task) {
getScheduler().runTask(task);
if (IS_FOLIA) {
getScheduler().runTask(task);
} else {
Bukkit.getScheduler().runTask(authMe, task);
}
}
public void runTask(Entity entity, Runnable task) {
getScheduler().runTask(entity, task);
if (IS_FOLIA) {
getScheduler().runTask(entity, task);
} else {
Bukkit.getScheduler().runTask(authMe, task);
}
}
public void runTask(Location location, Runnable task) {