Added the config setting 'register-world-guard-allow-shop-flag'

(default: true).

This can be used to disable the registration of the 'allow-shop'
WorldGuard flag. Usually this should not be required though. Note that
changing this setting has no effect until the next server restart or
full server reload.

This replaces the just previously added system property
'shopkeepers.skip-wg-allow-shop-flag' again.
master
blablubbabc 2019-08-20 00:37:55 +02:00
parent 1939c02877
commit 066828e4be
4 changed files with 11 additions and 6 deletions

View File

@ -35,7 +35,7 @@ Date format: (YYYY-MM-DD)
* Changed: Some entity attributes are setup prior to entity spawning now (such as metadata, non-persist flag and name (if it has/uses one)). This should help other plugins to identify Shopkeeper entities during spawning.
* Changed: Added setting 'increment-villager-statistics' (default: false) which controls whether opening the trading menu and trading with shopkeepers increment minecraft's 'talked-to-villager' and 'traded-with-villager' statistics. Previously the talked-to-villager statistics would always get incremented and the traded-with-villager statistic was not used.
* Added: The previous, current and next page items inside the editor view will now use their stack size to visualize the previous, current and next page number. This even works for items which are usually not stackable.
* Added: Added a system property 'shopkeepers.skip-wg-allow-shop-flag' which can be used to disable the registration of the 'allow-shop' WorldGuard flag. This should usually not be required though.
* Added: Added the config setting 'register-world-guard-allow-shop-flag' (default: true) which can be used to disable the registration of the 'allow-shop' WorldGuard flag. Note that changing this setting has no effect until the next server restart or full server reload.
API:
* API: Added interfaces for the different shopkeeper types and their offers to the API. They allow modifying the shopkeepers' trades. Factory methods for the different types of offers are provided via ShopkeepersPlugin and ShopkeepersAPI. The internal shopkeeper classes got renamed.

View File

@ -213,11 +213,8 @@ public class SKShopkeepersPlugin extends JavaPlugin implements ShopkeepersPlugin
this.loadConfig();
// WorldGuard only allows registering flags before it gets enabled.
// By default, we always attempt to register the flag. There is no config setting for this, because this is not
// expected to be required. And a config setting would also not work for later config reloads.
// Instead, in case this is really required for some reason, a system property can be used to disable the flag
// registration.
if (System.getProperty("shopkeepers.skip-wg-allow-shop-flag", "false").equals("false")) {
// Note: Changing the config setting has no effect until the next server restart or server reload.
if (Settings.registerWorldGuardAllowShopFlag) {
WorldGuardHandler.registerAllowShopFlag();
}
}

View File

@ -53,6 +53,8 @@ public class Settings {
public static boolean enableWorldGuardRestrictions = false;
public static boolean requireWorldGuardAllowShopFlag = false;
public static boolean registerWorldGuardAllowShopFlag = true;
public static boolean enableTownyRestrictions = false;
/*

View File

@ -53,6 +53,12 @@ enable-world-guard-restrictions: false
# chests in the affected region, shop chests need to be pre-setup by someone
# else and the require-chest-recently-placed setting needs to be disabled.
require-world-guard-allow-shop-flag: false
# Whether to register the allow-shop flag with WorldGuard (if no other plugin
# has registered it yet). Usually there should be no need to disable this.
# Changing this setting has no effect until the next server restart or full
# server reload!
register-world-guard-allow-shop-flag: true
# If enabled, players will only be able to place shopkeepers in places that
# have been designated as commercial areas by Towny.
enable-towny-restrictions: false