From f7c0df686e029d0987039a4e4c4adb850e602217 Mon Sep 17 00:00:00 2001 From: granny Date: Fri, 31 May 2024 22:05:05 -0700 Subject: [PATCH] remove unnecessary global scheduler cancellation we only cancel it ourselves when the plugin is disabled, but that's already handled for us. This removes the call to a paper-only class, which should allow pl3xmap to run properly on spigot --- .../src/main/java/net/pl3x/map/bukkit/Pl3xMapBukkit.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/bukkit/src/main/java/net/pl3x/map/bukkit/Pl3xMapBukkit.java b/bukkit/src/main/java/net/pl3x/map/bukkit/Pl3xMapBukkit.java index 5862ecad1..8328dc6e8 100644 --- a/bukkit/src/main/java/net/pl3x/map/bukkit/Pl3xMapBukkit.java +++ b/bukkit/src/main/java/net/pl3x/map/bukkit/Pl3xMapBukkit.java @@ -24,7 +24,6 @@ package net.pl3x.map.bukkit; import java.util.UUID; -import io.papermc.paper.threadedregions.scheduler.ScheduledTask; import net.pl3x.map.bukkit.command.BukkitCommandManager; import net.pl3x.map.core.Pl3xMap; import net.pl3x.map.core.event.server.ServerLoadedEvent; @@ -50,7 +49,6 @@ public class Pl3xMapBukkit extends JavaPlugin implements Listener { private final Pl3xMapImpl pl3xmap; private final PlayerListener playerListener = new PlayerListener(); private boolean isFolia = false; - private ScheduledTask tickTimerTask = null; private Network network; @@ -81,7 +79,7 @@ public void onEnable() { } if (isFolia) { - tickTimerTask = Bukkit.getGlobalRegionScheduler().runAtFixedRate(this, timerTask -> + Bukkit.getGlobalRegionScheduler().runAtFixedRate(this, timerTask -> this.pl3xmap.getScheduler().tick(), 20, 1); } else { getServer().getScheduler().runTaskTimer(this, () -> @@ -96,10 +94,6 @@ public void onDisable() { this.network = null; } - if (tickTimerTask != null) { - tickTimerTask.cancel(); - } - this.pl3xmap.disable(); }