diff --git a/src/main/java/org/maxgamer/quickshop/QuickShop.java b/src/main/java/org/maxgamer/quickshop/QuickShop.java index fd106f750..d8e52db11 100644 --- a/src/main/java/org/maxgamer/quickshop/QuickShop.java +++ b/src/main/java/org/maxgamer/quickshop/QuickShop.java @@ -1902,6 +1902,10 @@ public class QuickShop extends JavaPlugin { getConfig().set("integration.griefprevention.delete-on-subclaim-created", false); getConfig().set("config-version", ++selectedVersion); } + if (selectedVersion == 138) { + getConfig().set("integration.towny.whitelist-mode", true); + getConfig().set("config-version", ++selectedVersion); + } if (getConfig().getInt("matcher.work-type") != 0 && GameVersion.get(ReflectFactory.getServerVersion()).name().contains("1_16")) { getLogger().warning("You are not using QS Matcher, it may meeting item comparing issue mentioned there: https://hub.spigotmc.org/jira/browse/SPIGOT-5063"); diff --git a/src/main/java/org/maxgamer/quickshop/integration/towny/TownyIntegration.java b/src/main/java/org/maxgamer/quickshop/integration/towny/TownyIntegration.java index 3630b962b..e30685a73 100644 --- a/src/main/java/org/maxgamer/quickshop/integration/towny/TownyIntegration.java +++ b/src/main/java/org/maxgamer/quickshop/integration/towny/TownyIntegration.java @@ -58,6 +58,7 @@ public class TownyIntegration extends QSIntegratedPlugin implements Listener { private final boolean deleteShopOnLeave; private final boolean deleteShopOnPlotClear; private boolean isNewVersion; + private boolean whiteList; public TownyIntegration(QuickShop plugin) { @@ -67,6 +68,7 @@ public class TownyIntegration extends QSIntegratedPlugin implements Listener { ignoreDisabledWorlds = plugin.getConfig().getBoolean("integration.towny.ignore-disabled-worlds"); deleteShopOnLeave = plugin.getConfig().getBoolean("integration.towny.delete-shop-on-resident-leave"); deleteShopOnPlotClear = plugin.getConfig().getBoolean("integration.towny.delete-shop-on-plot-clear"); + whiteList = plugin.getConfig().getBoolean("integration.towny.whitelist-mode"); //Testing if there have new method try { Town.class.getDeclaredMethod("getHomeblockWorld"); @@ -185,6 +187,9 @@ public class TownyIntegration extends QSIntegratedPlugin implements Listener { Util.debugLog("This world disabled Towny."); return true; } + if (!whiteList && !ShopPlotUtil.isShopPlot(location)) { + return true; + } for (TownyFlags flag : flags) { switch (flag) { case OWN: diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 3a0179d56..af73e4f2b 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -22,7 +22,7 @@ # TO EDIT QUICKSHOP'S CONFIGURATION, USE THE "config.yml" FILE! #Do not touch this if you don't know what you're doing! -config-version: 138 +config-version: 139 #Select the language you want to use, (e.g de), use only supported language codes from the list below. #If you use a not existant/not supported language, then QuickShop will use en_US. @@ -600,6 +600,8 @@ integration: trade: [] delete-shop-on-resident-leave: false delete-shop-on-plot-clear: true + #Should we prevent the creation of a shop or trade with a shop outside Towny's area + whitelist-mode: true #WorldGuard Integration #CHANGES REQUIRE A SERVER RESTART! #CHANGES REQUIRE A SERVER RESTART!