CombatUtils: Don't run checks against party features if parties are disabled

This commit is contained in:
Dieu 2024-05-06 01:32:56 +02:00
parent 5ba6305ad4
commit efb8d6088e

View File

@ -968,9 +968,11 @@ public final class CombatUtils {
return false; 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))) { if ((mcMMO.p.getPartyManager().inSameParty(player, defender) || mcMMO.p.getPartyManager().areAllies(player, defender)) && !(Permissions.friendlyFire(player) && Permissions.friendlyFire(defender))) {
return false; return false;
} }
}
// Vanished players should not be able to get hit by AoE effects // Vanished players should not be able to get hit by AoE effects
if (!player.canSee(defender)) { if (!player.canSee(defender)) {
@ -1019,7 +1021,7 @@ public final class CombatUtils {
if (tamer instanceof Player owner) { 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))));
} }
} }