Fix for options which disable wilderness explosions (TNT, creepers, fireballs) not actually disabling them; player->player damage is now also prevented if attacker is in a safe zone and defender is not (attacking from safety that way was exploity)
This commit is contained in:
parent
d0a405ff95
commit
85fd5eb04d
@ -94,11 +94,6 @@ public class FactionsEntityListener extends EntityListener {
|
|||||||
|
|
||||||
Faction faction = Board.getFactionAt(new FLocation(event.getLocation()));
|
Faction faction = Board.getFactionAt(new FLocation(event.getLocation()));
|
||||||
|
|
||||||
// Explosions may happen in the wilderness
|
|
||||||
if (faction.isNone()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (event.getEntity() instanceof Creeper && (
|
if (event.getEntity() instanceof Creeper && (
|
||||||
(faction.isNone() && Conf.wildernessBlockCreepers) ||
|
(faction.isNone() && Conf.wildernessBlockCreepers) ||
|
||||||
(faction.isNormal() && Conf.territoryBlockCreepers) ||
|
(faction.isNormal() && Conf.territoryBlockCreepers) ||
|
||||||
@ -161,6 +156,12 @@ public class FactionsEntityListener extends EntityListener {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// so we know from above that the defender isn't in a safezone... what about the attacker, sneaky dog that he might be?
|
||||||
|
if (Board.getFactionAt(new FLocation(attacker)).isSafeZone()) {
|
||||||
|
attacker.sendMessage("You can't hurt other players while you are in a SafeZone.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
Relation relation = defender.getRelation(attacker);
|
Relation relation = defender.getRelation(attacker);
|
||||||
|
|
||||||
// Players without faction may be hurt anywhere
|
// Players without faction may be hurt anywhere
|
||||||
|
Loading…
Reference in New Issue
Block a user