From b3796c31f2ee0b70c624fc851c0a50c6475f8aa2 Mon Sep 17 00:00:00 2001 From: Brettflan Date: Sun, 18 Dec 2011 08:39:52 -0600 Subject: [PATCH] Added soil to the default "territoryProtectedMaterials" and "territoryProtectedMaterialsWhenOffline" settings, so people who aren't in your faction won't be able to trample crops in your territory (soil trampling is handled as an Interact event, for whatever reason) For servers updating from older versions of Factions, you should use these commands to update your configuration: f config territoryProtectedMaterials SOIL f config territoryProtectedMaterialsWhenOffline SOIL --- src/com/massivecraft/factions/Conf.java | 2 ++ .../massivecraft/factions/listeners/FactionsPlayerListener.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/com/massivecraft/factions/Conf.java b/src/com/massivecraft/factions/Conf.java index 29aa4249..05732208 100644 --- a/src/com/massivecraft/factions/Conf.java +++ b/src/com/massivecraft/factions/Conf.java @@ -277,6 +277,7 @@ public class Conf territoryProtectedMaterials.add(Material.BREWING_STAND); territoryProtectedMaterials.add(Material.ENCHANTMENT_TABLE); territoryProtectedMaterials.add(Material.CAULDRON); + territoryProtectedMaterials.add(Material.SOIL); territoryDenyUseageMaterials.add(Material.FLINT_AND_STEEL); territoryDenyUseageMaterials.add(Material.BUCKET); @@ -296,6 +297,7 @@ public class Conf territoryProtectedMaterialsWhenOffline.add(Material.BREWING_STAND); territoryProtectedMaterialsWhenOffline.add(Material.ENCHANTMENT_TABLE); territoryProtectedMaterialsWhenOffline.add(Material.CAULDRON); + territoryProtectedMaterialsWhenOffline.add(Material.SOIL); territoryDenyUseageMaterialsWhenOffline.add(Material.FLINT_AND_STEEL); territoryDenyUseageMaterialsWhenOffline.add(Material.BUCKET); diff --git a/src/com/massivecraft/factions/listeners/FactionsPlayerListener.java b/src/com/massivecraft/factions/listeners/FactionsPlayerListener.java index 61bedb77..72ba991a 100644 --- a/src/com/massivecraft/factions/listeners/FactionsPlayerListener.java +++ b/src/com/massivecraft/factions/listeners/FactionsPlayerListener.java @@ -441,7 +441,7 @@ public class FactionsPlayerListener extends PlayerListener if (rel.isNeutral() || (rel.isEnemy() && Conf.territoryEnemyProtectMaterials) || (rel.isAlly() && Conf.territoryAllyProtectMaterials)) { if (!justCheck) - me.msg("You can't use %s in the territory of %s.", TextUtil.getMaterialName(material), otherFaction.getTag(myFaction)); + me.msg("You can't %s %s in the territory of %s.", (material == Material.SOIL ? "trample" : "use"), TextUtil.getMaterialName(material), otherFaction.getTag(myFaction)); return false; }