From ddf32eda04235bca808405f267f3593858d5b685 Mon Sep 17 00:00:00 2001 From: Andrzej Pomirski Date: Sun, 22 Jun 2014 14:32:40 +0200 Subject: [PATCH] Add an option to not remove LWC protections --- .../java/com/Acrobot/ChestShop/Configuration/Properties.java | 3 +++ .../Acrobot/ChestShop/Plugins/LightweightChestProtection.java | 4 +--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/Acrobot/ChestShop/Configuration/Properties.java b/src/main/java/com/Acrobot/ChestShop/Configuration/Properties.java index 5306bdb..7fff108 100644 --- a/src/main/java/com/Acrobot/ChestShop/Configuration/Properties.java +++ b/src/main/java/com/Acrobot/ChestShop/Configuration/Properties.java @@ -129,6 +129,9 @@ public class Properties { @ConfigurationComment("Do you want to protect shop signs with LWC?") public static boolean PROTECT_SIGN_WITH_LWC = false; + @ConfigurationComment("Should the chest's LWC protection be removed once the shop sign is destroyed? ") + public static boolean REMOVE_LWC_PROTECTION_AUTOMATICALLY = true; + @PrecededBySpace @ConfigurationComment("If true, plugin will generate shop statistics webpage.") public static boolean GENERATE_STATISTICS_PAGE = false; diff --git a/src/main/java/com/Acrobot/ChestShop/Plugins/LightweightChestProtection.java b/src/main/java/com/Acrobot/ChestShop/Plugins/LightweightChestProtection.java index 7214010..47e1204 100644 --- a/src/main/java/com/Acrobot/ChestShop/Plugins/LightweightChestProtection.java +++ b/src/main/java/com/Acrobot/ChestShop/Plugins/LightweightChestProtection.java @@ -7,11 +7,9 @@ import com.Acrobot.ChestShop.Events.Protection.ProtectionCheckEvent; import com.Acrobot.ChestShop.Events.ShopCreatedEvent; import com.Acrobot.ChestShop.Events.ShopDestroyedEvent; import com.Acrobot.ChestShop.Security; -import com.Acrobot.ChestShop.UUIDs.NameManager; import com.griefcraft.lwc.LWC; import com.griefcraft.model.Protection; import com.griefcraft.scripting.event.LWCProtectionRegisterEvent; -import org.bukkit.Bukkit; import org.bukkit.block.Block; import org.bukkit.block.Chest; import org.bukkit.block.Sign; @@ -115,7 +113,7 @@ public class LightweightChestProtection implements Listener { signProtection.remove(); } - if (event.getChest() == null) { + if (event.getChest() == null || !Properties.REMOVE_LWC_PROTECTION_AUTOMATICALLY) { return; }