From f6facbc08b36f7630bfc6d269f6f8d7bc72693b9 Mon Sep 17 00:00:00 2001 From: Dieu Date: Wed, 21 Feb 2024 19:21:17 +0100 Subject: [PATCH] Only run PartyAutoKickTask Task if Parties are enabled --- src/main/java/com/gmail/nossr50/mcMMO.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/mcMMO.java b/src/main/java/com/gmail/nossr50/mcMMO.java index 025e36f90..700699140 100644 --- a/src/main/java/com/gmail/nossr50/mcMMO.java +++ b/src/main/java/com/gmail/nossr50/mcMMO.java @@ -671,13 +671,14 @@ public class mcMMO extends JavaPlugin { } // Automatically remove old members from parties - long kickIntervalTicks = generalConfig.getAutoPartyKickInterval() * 60L * 60L * Misc.TICK_CONVERSION_FACTOR; + if(partyConfig.isPartyEnabled()) { + long kickIntervalTicks = generalConfig.getAutoPartyKickInterval() * 60L * 60L * Misc.TICK_CONVERSION_FACTOR; - if (kickIntervalTicks == 0) { - getFoliaLib().getImpl().runLater(new PartyAutoKickTask(), 2 * Misc.TICK_CONVERSION_FACTOR); // Start 2 seconds after startup. - } - else if (kickIntervalTicks > 0) { - getFoliaLib().getImpl().runTimer(new PartyAutoKickTask(), kickIntervalTicks, kickIntervalTicks); + if (kickIntervalTicks == 0) { + getFoliaLib().getImpl().runLater(new PartyAutoKickTask(), 2 * Misc.TICK_CONVERSION_FACTOR); // Start 2 seconds after startup. + } else if (kickIntervalTicks > 0) { + getFoliaLib().getImpl().runTimer(new PartyAutoKickTask(), kickIntervalTicks, kickIntervalTicks); + } } // Update power level tag scoreboards