mirror of
https://github.com/EarthMC/QuickShop-Reremake.git
synced 2026-11-25 09:59:49 -05:00
Merge pull request #1364 from raphtaliapt/master
Added whitelist-mode option to Towny Integration (user requested)
This commit is contained in:
commit
698aea5aef
3 files changed
+12
-1
No files matched your search
@@ -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");
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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!
|
||||
|
||||
Reference in new issue
Block a user