mirror of
https://github.com/amalthea-mc/ShopChest.git
synced 2024-11-09 20:21:07 +00:00
Method getShops now returns a collection
This commit is contained in:
parent
5bb338494d
commit
48059811fb
@ -18,6 +18,7 @@ import java.util.*;
|
|||||||
public class ShopUtils {
|
public class ShopUtils {
|
||||||
|
|
||||||
private final HashMap<Location, Shop> shopLocation = new HashMap<>();
|
private final HashMap<Location, Shop> shopLocation = new HashMap<>();
|
||||||
|
private final Collection<Shop> shopLocationValues = Collections.unmodifiableCollection(shopLocation.values());
|
||||||
private final HashMap<UUID, Location> playerLocation = new HashMap<>();
|
private final HashMap<UUID, Location> playerLocation = new HashMap<>();
|
||||||
private final ShopChest plugin;
|
private final ShopChest plugin;
|
||||||
|
|
||||||
@ -48,11 +49,11 @@ public class ShopUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get all Shops
|
* Get all shops
|
||||||
* @return Array of all Shops
|
* @return Read-only collection of all shops, may contain duplicates
|
||||||
*/
|
*/
|
||||||
public Shop[] getShops() {
|
public Collection<Shop> getShops() {
|
||||||
return shopLocation.values().toArray(new Shop[0]);
|
return shopLocationValues;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user