From bc84f3418e6a0829a17853aad90a163d27b66f8d Mon Sep 17 00:00:00 2001 From: Ghost_chu <2908803755@qq.com> Date: Tue, 20 Nov 2018 23:22:52 +0800 Subject: [PATCH] [BETA]Unlimited shop nolonger calc in limits Former-commit-id: b92d67f7a1dbaff360fd7e27533577214751ba13 [formerly 5b4fe1fbb24de417219b32ebdccba4878db617c7] Former-commit-id: 11d057f67c512156abb889fa42988f44bd324366 --- .../maxgamer/quickshop/Shop/ShopManager.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/maxgamer/quickshop/Shop/ShopManager.java b/src/main/java/org/maxgamer/quickshop/Shop/ShopManager.java index 135e8858a..12226c493 100644 --- a/src/main/java/org/maxgamer/quickshop/Shop/ShopManager.java +++ b/src/main/java/org/maxgamer/quickshop/Shop/ShopManager.java @@ -253,12 +253,21 @@ public class ShopManager { if (plugin.limit) { int owned = 0; - Iterator it = getShopIterator(); - while (it.hasNext()) { - if (it.next().getOwner().equals(p.getUniqueId())) { - owned++; + for (HashMap> shopmap : getShops().values()) { + for (HashMap shopLocs : shopmap.values()) { + for (Shop shop : shopLocs.values()) { + if (shop.getOwner().equals(p.getUniqueId())&&shop.isUnlimited()) { + owned++; + } + } } } +// Iterator it = getShopIterator(); +// while (it.hasNext()) { +// if (it.next().getOwner().equals(p.getUniqueId())) { +// owned++; +// } +// } int max = plugin.getShopLimit(p); if (owned + 1 > max) { //p.sendMessage(ChatColor.RED + "You have already created a maximum of " + owned + "/" + max + " shops!");