Skip to content

Commit

Permalink
remove unnecessary global scheduler cancellation
Browse files Browse the repository at this point in the history
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
  • Loading branch information
granny committed Jun 1, 2024
1 parent 799f804 commit f7c0df6
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions bukkit/src/main/java/net/pl3x/map/bukkit/Pl3xMapBukkit.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down Expand Up @@ -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, () ->
Expand All @@ -96,10 +94,6 @@ public void onDisable() {
this.network = null;
}

if (tickTimerTask != null) {
tickTimerTask.cancel();
}

this.pl3xmap.disable();
}

Expand Down

0 comments on commit f7c0df6

Please sign in to comment.