diff --git a/src/main/java/org/maxgamer/quickshop/Shop/ShopManager.java b/src/main/java/org/maxgamer/quickshop/Shop/ShopManager.java index a98b7f907..af2913600 100644 --- a/src/main/java/org/maxgamer/quickshop/Shop/ShopManager.java +++ b/src/main/java/org/maxgamer/quickshop/Shop/ShopManager.java @@ -965,4 +965,24 @@ public class ShopManager { public @Nullable Set getLoadedShops() { return this.loadedShops; } + + /** + * Get a players all shops. + * @param playerUUID The player's uuid. + * @param ignoreUnlimitedShop Set we should ignore unlimited to get. + * @return The list have this player's all shops. + */ + public @NotNull List getPlayerAllShops(@NotNull UUID playerUUID, boolean ignoreUnlimitedShop){ + List collectedShops = new ArrayList<>(); + for(Shop shop : getAllShops()){ + if(!shop.getOwner().equals(playerUUID)){ + continue; + } + if(ignoreUnlimitedShop && shop.isUnlimited()){ + continue; + } + collectedShops.add(shop); + } + return collectedShops; + } }