diff --git a/src/main/java/org/maxgamer/quickshop/QuickShop.java b/src/main/java/org/maxgamer/quickshop/QuickShop.java index 9f3893186..3555cee29 100644 --- a/src/main/java/org/maxgamer/quickshop/QuickShop.java +++ b/src/main/java/org/maxgamer/quickshop/QuickShop.java @@ -902,7 +902,11 @@ public class QuickShop extends JavaPlugin { getConfig().set("config-version", 46); selectedVersion = 46; } - + if (selectedVersion == 46) { + getConfig().set("shop.use-protection-checking-filter", false); + getConfig().set("config-version", 47); + selectedVersion = 47; + } saveConfig(); reloadConfig(); File file = new File(getDataFolder(), "example.config.yml"); diff --git a/src/main/java/org/maxgamer/quickshop/Util/PermissionChecker.java b/src/main/java/org/maxgamer/quickshop/Util/PermissionChecker.java index 4cedc3fc3..ffaf9c96f 100644 --- a/src/main/java/org/maxgamer/quickshop/Util/PermissionChecker.java +++ b/src/main/java/org/maxgamer/quickshop/Util/PermissionChecker.java @@ -55,7 +55,12 @@ public class PermissionChecker { //Bukkit.getPluginManager().callEvent(beMainHand); beMainHand.setDropItems(false); beMainHand.setExpToDrop(-1); - Plugin cancelPlugin = plugin.getQsEventManager().fireEvent(beMainHand); + Plugin cancelPlugin = null; + if(plugin.getConfig().getBoolean("shop.use-protection-checking-filter")){ + cancelPlugin = plugin.getQsEventManager().fireEvent(beMainHand); + }else{ + Bukkit.getPluginManager().callEvent(beMainHand); + } //Use our custom event caller. ListenerHelper.enableEvent(beMainHand.getClass()); //Call for event for protection check end @@ -69,8 +74,6 @@ public class PermissionChecker { // } if(cancelPlugin != null) { Util.debugLog("Plugin " + cancelPlugin.getName() + " cancelled this build create action."); - }else{ - Util.debugLog("Internal server error."); } } diff --git a/src/main/java/org/maxgamer/quickshop/Util/QSEventManager.java b/src/main/java/org/maxgamer/quickshop/Util/QSEventManager.java index ba96872fc..2944fc4f7 100644 --- a/src/main/java/org/maxgamer/quickshop/Util/QSEventManager.java +++ b/src/main/java/org/maxgamer/quickshop/Util/QSEventManager.java @@ -76,6 +76,7 @@ public class QSEventManager { } Set containers = containerSet.get(registration.getPlugin().getName()); if (containers == null) { + Util.debugLog("Container is null, skipping..."); continue; } for (PluginEventFilterContainer container : containers) { diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index cf42aca4b..ce3ffd3a1 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -1,7 +1,7 @@ #This is example config, don't direct modify this file, all changes will revert when you reload the plugin. #Do not touch if you not clear know about this -config-version: 46 +config-version: 47 #Select the language you want to use, (e.g de), use only supported language codes from the list below. #If you use a not exist/not support language, plugin will move to use en_US to keep everything working. @@ -231,6 +231,7 @@ shop: #Protection advanced event calling filter #Advance users only. + use-protection-checking-filter: false protection-checking-filter: [] # - PLUGIN##LISTENER##EVENT #Example: - QuickShop##org.maxgamer.Listeners.BlockListener##org.bukkit.event.block.BlockPlaceEvent