Add an option to not remove LWC protections

This commit is contained in:
Andrzej Pomirski 2014-06-22 14:32:40 +02:00
parent 9fa2f92ef8
commit ddf32eda04
2 changed files with 4 additions and 3 deletions

View File

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

View File

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