From 3a3b09da6157d0ffb03a8e13c4f8a7ca32d85ed0 Mon Sep 17 00:00:00 2001 From: Brettflan Date: Wed, 1 Jun 2011 18:13:56 -0500 Subject: [PATCH] New "territoryDenyBuild" and "territoryDenyUseage" options, so block protection and interaction prevention can be disabled on faction claimed land. Also added trap doors to the default "territoryProtectedMaterials" list. --- src/org/mcteam/factions/Conf.java | 3 +++ src/org/mcteam/factions/listeners/FactionsBlockListener.java | 2 +- src/org/mcteam/factions/listeners/FactionsEntityListener.java | 2 +- src/org/mcteam/factions/listeners/FactionsPlayerListener.java | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/org/mcteam/factions/Conf.java b/src/org/mcteam/factions/Conf.java index 353ae0d3..8e105714 100644 --- a/src/org/mcteam/factions/Conf.java +++ b/src/org/mcteam/factions/Conf.java @@ -60,6 +60,8 @@ public class Conf { public static double homesTeleportAllowedEnemyDistance = 32; public static double territoryShieldFactor = 0.5; + public static boolean territoryDenyBuild = true; + public static boolean territoryDenyUseage = true; public static boolean territoryBlockCreepers = false; public static boolean territoryBlockFireballs = false; public static boolean territoryBlockTNT = false; @@ -89,6 +91,7 @@ public class Conf { static { territoryProtectedMaterials.add(Material.WOODEN_DOOR); + territoryProtectedMaterials.add(Material.TRAP_DOOR); territoryProtectedMaterials.add(Material.DISPENSER); territoryProtectedMaterials.add(Material.CHEST); territoryProtectedMaterials.add(Material.FURNACE); diff --git a/src/org/mcteam/factions/listeners/FactionsBlockListener.java b/src/org/mcteam/factions/listeners/FactionsBlockListener.java index 52714664..7935f67d 100644 --- a/src/org/mcteam/factions/listeners/FactionsBlockListener.java +++ b/src/org/mcteam/factions/listeners/FactionsBlockListener.java @@ -84,7 +84,7 @@ public class FactionsBlockListener extends BlockListener { Faction myFaction = me.getFaction(); // Cancel if we are not in our own territory - if (myFaction != otherFaction) { + if (myFaction != otherFaction && Conf.territoryDenyBuild) { me.sendMessage("You can't "+action+" in the territory of "+otherFaction.getTag(myFaction)); return false; } diff --git a/src/org/mcteam/factions/listeners/FactionsEntityListener.java b/src/org/mcteam/factions/listeners/FactionsEntityListener.java index 33f62a6d..5a08e8cf 100644 --- a/src/org/mcteam/factions/listeners/FactionsEntityListener.java +++ b/src/org/mcteam/factions/listeners/FactionsEntityListener.java @@ -287,7 +287,7 @@ public class FactionsEntityListener extends EntityListener { Faction myFaction = me.getFaction(); // Cancel if we are not in our own territory - if (myFaction != otherFaction) { + if (myFaction != otherFaction && Conf.territoryDenyBuild) { me.sendMessage("You can't "+action+" paintings in the territory of "+otherFaction.getTag(myFaction)); return false; } diff --git a/src/org/mcteam/factions/listeners/FactionsPlayerListener.java b/src/org/mcteam/factions/listeners/FactionsPlayerListener.java index a04c0679..2e81f13f 100644 --- a/src/org/mcteam/factions/listeners/FactionsPlayerListener.java +++ b/src/org/mcteam/factions/listeners/FactionsPlayerListener.java @@ -211,7 +211,7 @@ public class FactionsPlayerListener extends PlayerListener{ Faction myFaction = me.getFaction(); // Cancel if we are not in our own territory - if (myFaction != otherFaction) { + if (myFaction != otherFaction && Conf.territoryDenyUseage) { me.sendMessage("You can't use "+TextUtil.getMaterialName(material)+" in the territory of "+otherFaction.getTag(myFaction)); return false; }