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; }