From 48059811fb64ff3a47d55e9c5be325b16ddc2197 Mon Sep 17 00:00:00 2001 From: MineTheCube Date: Thu, 27 Jul 2017 13:10:00 +0200 Subject: [PATCH] Method getShops now returns a collection --- src/main/java/de/epiceric/shopchest/utils/ShopUtils.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/de/epiceric/shopchest/utils/ShopUtils.java b/src/main/java/de/epiceric/shopchest/utils/ShopUtils.java index 029d091..ba5755d 100644 --- a/src/main/java/de/epiceric/shopchest/utils/ShopUtils.java +++ b/src/main/java/de/epiceric/shopchest/utils/ShopUtils.java @@ -18,6 +18,7 @@ import java.util.*; public class ShopUtils { private final HashMap shopLocation = new HashMap<>(); + private final Collection shopLocationValues = Collections.unmodifiableCollection(shopLocation.values()); private final HashMap playerLocation = new HashMap<>(); private final ShopChest plugin; @@ -48,11 +49,11 @@ public class ShopUtils { } /** - * Get all Shops - * @return Array of all Shops + * Get all shops + * @return Read-only collection of all shops, may contain duplicates */ - public Shop[] getShops() { - return shopLocation.values().toArray(new Shop[0]); + public Collection getShops() { + return shopLocationValues; } /**