From 2bacca0915c707a002ccfa4695f2b10e8e7b29a0 Mon Sep 17 00:00:00 2001 From: Eric Date: Sun, 13 Nov 2016 20:58:48 +0100 Subject: [PATCH] Fix shop limits configuration --- .../de/epiceric/shopchest/config/Config.java | 18 +----------------- src/main/resources/config.yml | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/src/main/java/de/epiceric/shopchest/config/Config.java b/src/main/java/de/epiceric/shopchest/config/Config.java index 969a783..486df2c 100644 --- a/src/main/java/de/epiceric/shopchest/config/Config.java +++ b/src/main/java/de/epiceric/shopchest/config/Config.java @@ -50,20 +50,6 @@ public class Config { **/ public Set minimum_prices; - /** - *

The shop limits of certain groups

- * This returns a key set, which contains the group names, of the shop-limits.group section in ShopChest's config. - * To actually retrieve the limits for a group, you have to get the Integer shop-limits.group.key. - **/ - public Set shopLimits_group; - - /** - *

The shop limits of certain players

- * This returns a key set, which contains the player names, of the shop-limits.player section in ShopChest's config. - * To actually retrieve the limits for a player, you have to get the Integer shop-limits.player.key. - **/ - public Set shopLimits_player; - /** *

List containing items, of which players can't create a shop

* 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 **/ 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; /** 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_broken_items = plugin.getConfig().getBoolean("allow-broken-items"); 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() : plugin.getConfig().getConfigurationSection("shop-limits.group").getKeys(true); - shopLimits_player = (plugin.getConfig().getConfigurationSection("shop-limits.player") == null) ? new HashSet() : plugin.getConfig().getConfigurationSection("shop-limits.player").getKeys(true); blacklist = (plugin.getConfig().getStringList("blacklist") == null) ? new ArrayList() : plugin.getConfig().getStringList("blacklist"); buy_greater_or_equal_sell = plugin.getConfig().getBoolean("buy-greater-or-equal-sell"); hopper_protection = plugin.getConfig().getBoolean("hopper-protection"); diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index d3f4e43..4424db0 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -131,4 +131,17 @@ database: # ...password you are going to login with # Be careful, as anyone who can read this file, can read the password! - password: "" \ No newline at end of file + 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 \ No newline at end of file