From 58d97076b8ec1ed9343c718165fbda29f5bbffc0 Mon Sep 17 00:00:00 2001 From: Brettflan Date: Sat, 1 Oct 2011 06:16:53 -0500 Subject: [PATCH] New conf.json setting "territoryDenyEndermanBlocksWhenOffline" (default true). As might be expected, this will prevent Enderman from removing or placing blocks in the territory of a faction which has no members online. "territoryDenyEndermanBlocks" of course now only applies when a faction has members online. --- src/com/massivecraft/factions/Conf.java | 1 + .../factions/listeners/FactionsEntityListener.java | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/com/massivecraft/factions/Conf.java b/src/com/massivecraft/factions/Conf.java index f75f459e..e84e8bed 100644 --- a/src/com/massivecraft/factions/Conf.java +++ b/src/com/massivecraft/factions/Conf.java @@ -130,6 +130,7 @@ public class Conf { public static boolean territoryBlockTNT = false; public static boolean territoryBlockTNTWhenOffline = false; public static boolean territoryDenyEndermanBlocks = true; + public static boolean territoryDenyEndermanBlocksWhenOffline = true; public static boolean safeZoneDenyBuild = true; public static boolean safeZoneDenyUseage = true; diff --git a/src/com/massivecraft/factions/listeners/FactionsEntityListener.java b/src/com/massivecraft/factions/listeners/FactionsEntityListener.java index 687e347f..83a6a9f0 100644 --- a/src/com/massivecraft/factions/listeners/FactionsEntityListener.java +++ b/src/com/massivecraft/factions/listeners/FactionsEntityListener.java @@ -421,6 +421,7 @@ public class FactionsEntityListener extends EntityListener { // quick check to see if all Enderman deny options are enabled; if so, no need to check location if ( Conf.wildernessDenyEndermanBlocks && Conf.territoryDenyEndermanBlocks + && Conf.territoryDenyEndermanBlocksWhenOffline && Conf.safeZoneDenyEndermanBlocks && Conf.warZoneDenyEndermanBlocks ) { @@ -434,7 +435,7 @@ public class FactionsEntityListener extends EntityListener { return Conf.wildernessDenyEndermanBlocks; } else if (claimFaction.isNormal()) { - return Conf.territoryDenyEndermanBlocks; + return claimFaction.hasPlayersOnline() ? Conf.territoryDenyEndermanBlocks : Conf.territoryDenyEndermanBlocksWhenOffline; } else if (claimFaction.isSafeZone()) { return Conf.safeZoneDenyEndermanBlocks;