Fix shop limits configuration

This commit is contained in:
Eric 2016-11-13 20:58:48 +01:00
parent 3562a534c7
commit 2bacca0915
2 changed files with 15 additions and 18 deletions

View File

@ -50,20 +50,6 @@ public class Config {
**/ **/
public Set<String> minimum_prices; public Set<String> minimum_prices;
/**
* <p>The shop limits of certain groups</p>
* This returns a key set, which contains the group names, of the <i>shop-limits.group</i> section in ShopChest's config.
* To actually retrieve the limits for a group, you have to get the Integer <i>shop-limits.group.<b>key</b></i>.
**/
public Set<String> shopLimits_group;
/**
* <p>The shop limits of certain players</p>
* This returns a key set, which contains the player names, of the <i>shop-limits.player</i> section in ShopChest's config.
* To actually retrieve the limits for a player, you have to get the Integer <i>shop-limits.player.<b>key</b></i>.
**/
public Set<String> shopLimits_player;
/** /**
* <p>List containing items, of which players can't create a shop</p> * <p>List containing items, of which players can't create a shop</p>
* If this list contains an item (e.g "STONE", "STONE:1"), it's in the blacklist. * If this list contains an item (e.g "STONE", "STONE:1"), it's in the blacklist.
@ -124,7 +110,7 @@ public class Config {
/** The price a player has to pay in order to create an admin shop **/ /** The price a player has to pay in order to create an admin shop **/
public double shop_creation_price_admin; public double shop_creation_price_admin;
/** The default shop limit for players and groups that are not listed in {@link #shopLimits_player} or in {@link #shopLimits_group} **/ /** The default shop limit for players whose limit is not set via a permission **/
public int default_limit; public int default_limit;
/** The time between automatic shop reloads (if set to 0, the timer will be disabled) **/ /** The time between automatic shop reloads (if set to 0, the timer will be disabled) **/
@ -287,8 +273,6 @@ public class Config {
allow_decimals_in_price = plugin.getConfig().getBoolean("allow-decimals-in-price"); allow_decimals_in_price = plugin.getConfig().getBoolean("allow-decimals-in-price");
allow_broken_items = plugin.getConfig().getBoolean("allow-broken-items"); allow_broken_items = plugin.getConfig().getBoolean("allow-broken-items");
auto_calculate_item_amount = (allow_decimals_in_price && plugin.getConfig().getBoolean("auto-calculate-item-amount")); auto_calculate_item_amount = (allow_decimals_in_price && plugin.getConfig().getBoolean("auto-calculate-item-amount"));
shopLimits_group = (plugin.getConfig().getConfigurationSection("shop-limits.group") == null) ? new HashSet<String>() : plugin.getConfig().getConfigurationSection("shop-limits.group").getKeys(true);
shopLimits_player = (plugin.getConfig().getConfigurationSection("shop-limits.player") == null) ? new HashSet<String>() : plugin.getConfig().getConfigurationSection("shop-limits.player").getKeys(true);
blacklist = (plugin.getConfig().getStringList("blacklist") == null) ? new ArrayList<String>() : plugin.getConfig().getStringList("blacklist"); blacklist = (plugin.getConfig().getStringList("blacklist") == null) ? new ArrayList<String>() : plugin.getConfig().getStringList("blacklist");
buy_greater_or_equal_sell = plugin.getConfig().getBoolean("buy-greater-or-equal-sell"); buy_greater_or_equal_sell = plugin.getConfig().getBoolean("buy-greater-or-equal-sell");
hopper_protection = plugin.getConfig().getBoolean("hopper-protection"); hopper_protection = plugin.getConfig().getBoolean("hopper-protection");

View File

@ -132,3 +132,16 @@ database:
# ...password you are going to login with # ...password you are going to login with
# Be careful, as anyone who can read this file, can read the password! # Be careful, as anyone who can read this file, can read the password!
password: "" password: ""
# Shop limits are handled with permissions.
# A player with permission "shopchest.limit.X" has a limit of X shops,
# a player with permission "shopchest.limit.*" doesn't have a shop limit.
shop-limits:
# Set whether admin shops should be excluded of the shop limits.
# If set to true, admin shops won't be added to a player's shop count.
exclude-admin-shops: true
# Set the amount of shops anyone who's not listed in the sections below can have.
# If you don't want the players to have a limit, set the value to -1.
default: 5