mirror of
https://github.com/amalthea-mc/ShopChest.git
synced 2024-11-09 12:11:08 +00:00
Fixed ConcurrentModificationException (again)
This commit is contained in:
parent
c230257676
commit
efced89eb1
@ -205,8 +205,7 @@ public class ShopChest extends JavaPlugin {
|
||||
|
||||
if (database != null) {
|
||||
for (Shop shop : shopUtils.getShops()) {
|
||||
shop.removeHologram();
|
||||
shop.removeItem();
|
||||
shopUtils.removeShop(shop, false);
|
||||
debug("Removed shop (#" + shop.getID() + ")");
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,7 @@ import org.bukkit.inventory.InventoryHolder;
|
||||
import org.bukkit.permissions.PermissionAttachmentInfo;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
@ -23,7 +24,6 @@ import java.util.UUID;
|
||||
public class ShopUtils {
|
||||
|
||||
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 ShopChest plugin;
|
||||
|
||||
@ -58,7 +58,7 @@ public class ShopUtils {
|
||||
* @return Read-only collection of all shops, may contain duplicates
|
||||
*/
|
||||
public Collection<Shop> getShops() {
|
||||
return shopLocationValues;
|
||||
return Collections.unmodifiableCollection(new ArrayList<>(shopLocation.values()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user