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;
|
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.");
|
attacker.sendMessage("You can't hurt other players until you join a faction.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if (defLocFaction == attacker.getFaction() && Conf.enablePVPAgainstFactionlessInAttackersLand) {
|
else if (defendFaction.isNone()) {
|
||||||
|
if (defLocFaction == attackFaction && Conf.enablePVPAgainstFactionlessInAttackersLand) {
|
||||||
// Allow PVP vs. Factionless in attacker's faction territory
|
// Allow PVP vs. Factionless in attacker's faction territory
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (!defender.hasFaction() && Conf.disablePVPForFactionlessPlayers) {
|
else if (Conf.disablePVPForFactionlessPlayers) {
|
||||||
attacker.sendMessage("You can't hurt players who are not currently in a faction.");
|
attacker.sendMessage("You can't hurt players who are not currently in a faction.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Faction defendFaction = defender.getFaction();
|
|
||||||
Faction attackFaction = attacker.getFaction();
|
|
||||||
|
|
||||||
if (defendFaction.isPeaceful()) {
|
if (defendFaction.isPeaceful()) {
|
||||||
attacker.sendMessage("You can't hurt players who are in a peaceful faction.");
|
attacker.sendMessage("You can't hurt players who are in a peaceful faction.");
|
||||||
|
Loading…
Reference in New Issue
Block a user