From 76fafacc98a296fdfe3c13c1392e90f8a375c7d6 Mon Sep 17 00:00:00 2001 From: Euphyllia Bierque Date: Sun, 30 Jun 2024 18:08:25 +0200 Subject: [PATCH] Support Folia --- .../java/com/badbones69/crazyauctions/CrazyAuctions.java | 2 +- .../badbones69/crazyauctions/controllers/GuiListener.java | 6 +++--- paper/src/main/resources/plugin.yml | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/paper/src/main/java/com/badbones69/crazyauctions/CrazyAuctions.java b/paper/src/main/java/com/badbones69/crazyauctions/CrazyAuctions.java index ddd1d40..72925b0 100644 --- a/paper/src/main/java/com/badbones69/crazyauctions/CrazyAuctions.java +++ b/paper/src/main/java/com/badbones69/crazyauctions/CrazyAuctions.java @@ -128,7 +128,7 @@ public class CrazyAuctions extends JavaPlugin { TimerTask task = new TimerTask() { @Override public void run() { - getServer().getScheduler().runTask(get(), Methods::updateAuction); + getServer().getGlobalRegionScheduler().run(get(), t -> Methods.updateAuction()); } }; diff --git a/paper/src/main/java/com/badbones69/crazyauctions/controllers/GuiListener.java b/paper/src/main/java/com/badbones69/crazyauctions/controllers/GuiListener.java index 94507c1..f5be85d 100644 --- a/paper/src/main/java/com/badbones69/crazyauctions/controllers/GuiListener.java +++ b/paper/src/main/java/com/badbones69/crazyauctions/controllers/GuiListener.java @@ -967,7 +967,7 @@ public class GuiListener implements Listener { inv.setItem(slot, itemBuilder.build()); playClick(player); - Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, runnable, 3 * 20); + player.getScheduler().runDelayed(plugin, task -> runnable.run(), null, 3 * 20); return; } @@ -985,7 +985,7 @@ public class GuiListener implements Listener { inv.setItem(slot, itemBuilder.build()); playClick(player); - Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, runnable, 3 * 20); + player.getScheduler().runDelayed(plugin, task -> runnable.run(), null, 3 * 20); return; } @@ -1002,7 +1002,7 @@ public class GuiListener implements Listener { inv.setItem(slot, itemBuilder.build()); playClick(player); - Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, runnable, 3 * 20); + player.getScheduler().runDelayed(plugin, task -> runnable.run(), null, 3 * 20); return; } diff --git a/paper/src/main/resources/plugin.yml b/paper/src/main/resources/plugin.yml index 16403f7..aadf514 100644 --- a/paper/src/main/resources/plugin.yml +++ b/paper/src/main/resources/plugin.yml @@ -7,6 +7,7 @@ version: '${version}' api-version: '${apiVersion}' description: '${description}' website: '${website}' +folia-supported: true softdepend: [Vault]