From 43fa9d7534155c07b9da5dd6b03978598e84544b Mon Sep 17 00:00:00 2001 From: Daniel Zhang Date: Wed, 31 Jul 2024 22:29:47 +0800 Subject: [PATCH] Cancel on unload --- .../bukkit/competition/BukkitCompetitionManager.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/net/momirealms/customfishing/bukkit/competition/BukkitCompetitionManager.java b/core/src/main/java/net/momirealms/customfishing/bukkit/competition/BukkitCompetitionManager.java index 7e5edd42..7c685fe3 100644 --- a/core/src/main/java/net/momirealms/customfishing/bukkit/competition/BukkitCompetitionManager.java +++ b/core/src/main/java/net/momirealms/customfishing/bukkit/competition/BukkitCompetitionManager.java @@ -81,6 +81,8 @@ public class BukkitCompetitionManager implements CompetitionManager { this.timerCheckTask.cancel(); if (currentCompetition != null && currentCompetition.isOnGoing()) this.currentCompetition.stop(true); + if (this.redisPlayerCount != null) + this.redisPlayerCount.cancel(); this.commandConfigMap.clear(); this.timeConfigMap.clear(); } @@ -91,7 +93,8 @@ public class BukkitCompetitionManager implements CompetitionManager { if (currentCompetition != null && currentCompetition.isOnGoing()) this.currentCompetition.stop(false); if (this.redisPlayerCount != null) - this.commandConfigMap.clear(); + this.redisPlayerCount.cancel(); + this.commandConfigMap.clear(); this.timeConfigMap.clear(); }