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