mirror of
https://github.com/MassiveCraft/Factions.git
synced 2024-11-26 20:26:23 +01:00
New setting in conf.json:
"disablePVPBetweenNeutralFaction": false whether PvP damage will be disabled between neutral faction Change-Id: I08eee177fbe69d1466a267e67ec3fd0389f83499
This commit is contained in:
parent
62262a0b7d
commit
aaa56ec40a
@ -71,6 +71,7 @@ public class Conf {
|
|||||||
public static double homesTeleportAllowedEnemyDistance = 32;
|
public static double homesTeleportAllowedEnemyDistance = 32;
|
||||||
public static boolean homesTeleportIgnoreEnemiesIfInOwnTerritory = true;
|
public static boolean homesTeleportIgnoreEnemiesIfInOwnTerritory = true;
|
||||||
|
|
||||||
|
public static boolean disablePVPBetweenNeutralFaction = false;
|
||||||
public static boolean disablePVPForFactionlessPlayers = false;
|
public static boolean disablePVPForFactionlessPlayers = false;
|
||||||
public static int noPVPDamageToOthersForXSecondsAfterLogin = 3;
|
public static int noPVPDamageToOthersForXSecondsAfterLogin = 3;
|
||||||
|
|
||||||
|
@ -188,6 +188,12 @@ public class FactionsEntityListener extends EntityListener {
|
|||||||
|
|
||||||
Relation relation = defender.getRelation(attacker);
|
Relation relation = defender.getRelation(attacker);
|
||||||
|
|
||||||
|
// You can not hurt neutral factions
|
||||||
|
if (relation.isNeutral() && Conf.disablePVPBetweenNeutralFaction) {
|
||||||
|
attacker.sendMessage("You can't hurt neutral factions");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Players without faction may be hurt anywhere
|
// Players without faction may be hurt anywhere
|
||||||
if (defender.getFaction().isNone()) {
|
if (defender.getFaction().isNone()) {
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user