From efb8d6088ef25ea4ee7db4f6303e63a3d8db913a Mon Sep 17 00:00:00 2001 From: Dieu Date: Mon, 6 May 2024 01:32:56 +0200 Subject: [PATCH] CombatUtils: Don't run checks against party features if parties are disabled --- .../java/com/gmail/nossr50/util/skills/CombatUtils.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java b/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java index 168d778a3..35057f1f9 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java +++ b/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java @@ -968,8 +968,10 @@ public final class CombatUtils { return false; } - if ((mcMMO.p.getPartyManager().inSameParty(player, defender) || mcMMO.p.getPartyManager().areAllies(player, defender)) && !(Permissions.friendlyFire(player) && Permissions.friendlyFire(defender))) { - return false; + if(mcMMO.p.getPartyConfig().isPartyEnabled()) { + if ((mcMMO.p.getPartyManager().inSameParty(player, defender) || mcMMO.p.getPartyManager().areAllies(player, defender)) && !(Permissions.friendlyFire(player) && Permissions.friendlyFire(defender))) { + return false; + } } // Vanished players should not be able to get hit by AoE effects @@ -1019,7 +1021,7 @@ public final class CombatUtils { if (tamer instanceof Player owner) { - return (owner == attacker || mcMMO.p.getPartyManager().inSameParty(attacker, owner) || mcMMO.p.getPartyManager().areAllies(attacker, owner)); + return (owner == attacker || (mcMMO.p.getPartyConfig().isPartyEnabled() && (mcMMO.p.getPartyManager().inSameParty(attacker, owner) || mcMMO.p.getPartyManager().areAllies(attacker, owner)))); } }