From cdc187b2117c2427cfa500bc1fb320404bdd75c9 Mon Sep 17 00:00:00 2001 From: IAISI <126729304+IAISI@users.noreply.github.com> Date: Tue, 20 Feb 2024 18:20:08 +0100 Subject: [PATCH] Fix PartySaving related NPEs (only save parties if they're enabled) (#4973) Co-authored-by: Dieu --- src/main/java/com/gmail/nossr50/mcMMO.java | 3 ++- src/main/java/com/gmail/nossr50/runnables/SaveTimerTask.java | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/mcMMO.java b/src/main/java/com/gmail/nossr50/mcMMO.java index 20e429f8df..025e36f907 100644 --- a/src/main/java/com/gmail/nossr50/mcMMO.java +++ b/src/main/java/com/gmail/nossr50/mcMMO.java @@ -384,7 +384,8 @@ public void onDisable() { UserManager.saveAll(); // Make sure to save player information if the server shuts down UserManager.clearAll(); Alchemy.finishAllBrews(); // Finish all partially complete AlchemyBrewTasks to prevent vanilla brewing continuation on restart - getPartyManager().saveParties(); // Save our parties + if(partyConfig.isPartyEnabled()) + getPartyManager().saveParties(); // Save our parties //TODO: Needed? if(generalConfig.getScoreboardsEnabled()) diff --git a/src/main/java/com/gmail/nossr50/runnables/SaveTimerTask.java b/src/main/java/com/gmail/nossr50/runnables/SaveTimerTask.java index 32c6f8dd4d..d9822e1913 100644 --- a/src/main/java/com/gmail/nossr50/runnables/SaveTimerTask.java +++ b/src/main/java/com/gmail/nossr50/runnables/SaveTimerTask.java @@ -20,7 +20,7 @@ public void run() { count++; } - - mcMMO.p.getPartyManager().saveParties(); + if(mcMMO.p.getPartyConfig().isPartyEnabled()) + mcMMO.p.getPartyManager().saveParties(); } }