added option "disablePVPForFactionlessPlayers" to disable PvP damage to/from players who are not in a faction
This commit is contained in:
		@@ -64,6 +64,8 @@ public class Conf {
 | 
			
		||||
	public static boolean homesTeleportToOnDeath = true;
 | 
			
		||||
	public static double homesTeleportAllowedEnemyDistance = 32;
 | 
			
		||||
 | 
			
		||||
	public static boolean disablePVPForFactionlessPlayers = false;
 | 
			
		||||
 | 
			
		||||
	public static double territoryShieldFactor = 0.3;
 | 
			
		||||
	public static boolean territoryDenyBuild = true;
 | 
			
		||||
	public static boolean territoryDenyBuildWhenOffline = true;
 | 
			
		||||
 
 | 
			
		||||
@@ -160,6 +160,15 @@ public class FactionsEntityListener extends EntityListener {
 | 
			
		||||
			return true;
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		if (!attacker.hasFaction() && Conf.disablePVPForFactionlessPlayers) {
 | 
			
		||||
			attacker.sendMessage("You can't hurt other players until you join 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 locFaction = Board.getFactionAt(new FLocation(attacker));
 | 
			
		||||
		
 | 
			
		||||
		// so we know from above that the defender isn't in a safezone... what about the attacker, sneaky dog that he might be?
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user