Merge pull request #27 from Amrac/master

Disable pvp between neutral faction (conf)
This commit is contained in:
Brett Flannigan 2011-07-29 03:02:42 -07:00
commit e36e1419e9
2 changed files with 7 additions and 0 deletions

View File

@ -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;

View File

@ -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;