From 916ae2e1212bb05122347029aff12aff3eae62cd Mon Sep 17 00:00:00 2001 From: sandtechnology <20417547+sandtechnology@users.noreply.github.com> Date: Sat, 21 Mar 2020 01:29:11 +0800 Subject: [PATCH] Add an option to disable hopper protection Former-commit-id: b8bda361b6ad29c7b111e039eb0c5d757bc955f2 --- .../maxgamer/quickshop/Listeners/ShopProtectionListener.java | 4 +++- src/main/java/org/maxgamer/quickshop/QuickShop.java | 5 +++++ src/main/resources/config.yml | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/maxgamer/quickshop/Listeners/ShopProtectionListener.java b/src/main/java/org/maxgamer/quickshop/Listeners/ShopProtectionListener.java index 1eda5217b..6a06a10ba 100644 --- a/src/main/java/org/maxgamer/quickshop/Listeners/ShopProtectionListener.java +++ b/src/main/java/org/maxgamer/quickshop/Listeners/ShopProtectionListener.java @@ -176,7 +176,9 @@ public class ShopProtectionListener implements Listener { @EventHandler(ignoreCancelled = true, priority = EventPriority.HIGH) public void onInventoryMove(InventoryMoveItemEvent event) { - + if(!plugin.getConfig().getBoolean("protect.hopper")){ + return; + } final Location loc = event.getSource().getLocation(); if (loc == null) { diff --git a/src/main/java/org/maxgamer/quickshop/QuickShop.java b/src/main/java/org/maxgamer/quickshop/QuickShop.java index 9d61a8b79..d274723ef 100644 --- a/src/main/java/org/maxgamer/quickshop/QuickShop.java +++ b/src/main/java/org/maxgamer/quickshop/QuickShop.java @@ -1532,6 +1532,11 @@ public class QuickShop extends JavaPlugin { getConfig().set("config-version", 90); selectedVersion = 90; } + if(selectedVersion==90){ + getConfig().set("protect.hopper",true); + getConfig().set("config-version", 91); + selectedVersion=91; + } saveConfig(); reloadConfig(); File file = new File(getDataFolder(), "example.config.yml"); diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 792e4e819..4b78147e9 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -472,8 +472,10 @@ integration: warzone: false #Player must have flags in the faction: flags: [] +#the protection that shop should check protect: explode: true + hopper: true