mirror of
https://github.com/MassiveCraft/Factions.git
synced 2024-11-24 03:05:52 +01:00
Fix for players being able to hurt members of their own faction while in their own land if the "enablePVPAgainstFactionlessInAttackersLand" option is enabled
This commit is contained in:
parent
443e083f23
commit
538b387f2f
@ -204,21 +204,23 @@ public class FactionsEntityListener extends EntityListener {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!attacker.hasFaction() && Conf.disablePVPForFactionlessPlayers) {
|
||||
Faction defendFaction = defender.getFaction();
|
||||
Faction attackFaction = attacker.getFaction();
|
||||
|
||||
if (attackFaction.isNone() && Conf.disablePVPForFactionlessPlayers) {
|
||||
attacker.sendMessage("You can't hurt other players until you join a faction.");
|
||||
return false;
|
||||
}
|
||||
else if (defLocFaction == attacker.getFaction() && Conf.enablePVPAgainstFactionlessInAttackersLand) {
|
||||
// Allow PVP vs. Factionless in attacker's faction territory
|
||||
return true;
|
||||
else if (defendFaction.isNone()) {
|
||||
if (defLocFaction == attackFaction && Conf.enablePVPAgainstFactionlessInAttackersLand) {
|
||||
// Allow PVP vs. Factionless in attacker's faction territory
|
||||
return true;
|
||||
}
|
||||
else if (Conf.disablePVPForFactionlessPlayers) {
|
||||
attacker.sendMessage("You can't hurt players who are not currently in a faction.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (!defender.hasFaction() && Conf.disablePVPForFactionlessPlayers) {
|
||||
attacker.sendMessage("You can't hurt players who are not currently in a faction.");
|
||||
return false;
|
||||
}
|
||||
|
||||
Faction defendFaction = defender.getFaction();
|
||||
Faction attackFaction = attacker.getFaction();
|
||||
|
||||
if (defendFaction.isPeaceful()) {
|
||||
attacker.sendMessage("You can't hurt players who are in a peaceful faction.");
|
||||
|
Loading…
Reference in New Issue
Block a user