Added further "offline" options for preventing the 3 explosion types in faction territory; also fix for safe zone and war zone autoclaim bug
This commit is contained in:
		@@ -68,8 +68,11 @@ public class Conf {
 | 
			
		||||
	public static boolean territoryDenyBuildWhenOffline = true;
 | 
			
		||||
	public static boolean territoryDenyUseage = true;
 | 
			
		||||
	public static boolean territoryBlockCreepers = false;
 | 
			
		||||
	public static boolean territoryBlockCreepersWhenOffline = false;
 | 
			
		||||
	public static boolean territoryBlockFireballs = false;
 | 
			
		||||
	public static boolean territoryBlockFireballsWhenOffline = false;
 | 
			
		||||
	public static boolean territoryBlockTNT = false;
 | 
			
		||||
	public static boolean territoryBlockTNTWhenOffline = false;
 | 
			
		||||
 | 
			
		||||
	public static boolean safeZoneDenyBuild = true;
 | 
			
		||||
	public static boolean safeZoneDenyUseage = true;
 | 
			
		||||
 
 | 
			
		||||
@@ -93,10 +93,12 @@ public class FactionsEntityListener extends EntityListener {
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		Faction faction = Board.getFactionAt(new FLocation(event.getLocation()));
 | 
			
		||||
		boolean online = faction.HasPlayersOnline();
 | 
			
		||||
		
 | 
			
		||||
		if (event.getEntity() instanceof Creeper && (
 | 
			
		||||
				(faction.isNone() && Conf.wildernessBlockCreepers) ||
 | 
			
		||||
				(faction.isNormal() && Conf.territoryBlockCreepers) ||
 | 
			
		||||
				(faction.isNormal() && online && Conf.territoryBlockCreepers) ||
 | 
			
		||||
				(faction.isNormal() && !online && Conf.territoryBlockCreepersWhenOffline) ||
 | 
			
		||||
				(faction.isWarZone() && Conf.warZoneBlockCreepers) ||
 | 
			
		||||
				faction.isSafeZone()
 | 
			
		||||
				)) {
 | 
			
		||||
@@ -104,7 +106,8 @@ public class FactionsEntityListener extends EntityListener {
 | 
			
		||||
			event.setCancelled(true);
 | 
			
		||||
		} else if (event.getEntity() instanceof Fireball && (
 | 
			
		||||
				(faction.isNone() && Conf.wildernessBlockFireballs) ||
 | 
			
		||||
				(faction.isNormal() && Conf.territoryBlockFireballs) ||
 | 
			
		||||
				(faction.isNormal() && online && Conf.territoryBlockFireballs) ||
 | 
			
		||||
				(faction.isNormal() && !online && Conf.territoryBlockFireballsWhenOffline) ||
 | 
			
		||||
				(faction.isWarZone() && Conf.warZoneBlockFireballs) ||
 | 
			
		||||
				faction.isSafeZone()
 | 
			
		||||
				)) {
 | 
			
		||||
@@ -112,7 +115,8 @@ public class FactionsEntityListener extends EntityListener {
 | 
			
		||||
			event.setCancelled(true);
 | 
			
		||||
		} else if (
 | 
			
		||||
				(faction.isNone() && Conf.wildernessBlockTNT) ||
 | 
			
		||||
				(faction.isNormal() && Conf.territoryBlockTNT) ||
 | 
			
		||||
				(faction.isNormal() && online && Conf.territoryBlockTNT) ||
 | 
			
		||||
				(faction.isNormal() && !online && Conf.territoryBlockTNTWhenOffline) ||
 | 
			
		||||
				(faction.isWarZone() && Conf.warZoneBlockTNT) ||
 | 
			
		||||
				(faction.isSafeZone() && Conf.safeZoneBlockTNT)
 | 
			
		||||
				) {
 | 
			
		||||
 
 | 
			
		||||
@@ -186,7 +186,7 @@ public class FactionsPlayerListener extends PlayerListener{
 | 
			
		||||
				me.attemptClaim(false);
 | 
			
		||||
		}
 | 
			
		||||
		else if (me.autoSafeZoneEnabled()) {
 | 
			
		||||
			if (!Factions.hasPermManageSafeZone((CommandSender)me)) {
 | 
			
		||||
			if (!Factions.hasPermManageSafeZone((CommandSender)event.getPlayer())) {
 | 
			
		||||
				me.enableAutoSafeZone(false);
 | 
			
		||||
			} else {
 | 
			
		||||
				FLocation playerFlocation = new FLocation(me);
 | 
			
		||||
@@ -198,7 +198,7 @@ public class FactionsPlayerListener extends PlayerListener{
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		else if (me.autoWarZoneEnabled()) {
 | 
			
		||||
			if (!Factions.hasPermManageWarZone((CommandSender)me)) {
 | 
			
		||||
			if (!Factions.hasPermManageWarZone((CommandSender)event.getPlayer())) {
 | 
			
		||||
				me.enableAutoWarZone(false);
 | 
			
		||||
			} else {
 | 
			
		||||
				FLocation playerFlocation = new FLocation(me);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user