Don't remove shops when not iterating over copy

This commit is contained in:
Eric 2019-08-07 13:34:26 +02:00
parent d53ee08db9
commit 9c7170e109

View File

@ -52,7 +52,7 @@ public class AreaShopListener implements Listener {
private void removeShopsInRegion(GeneralRegion generalRegion) { private void removeShopsInRegion(GeneralRegion generalRegion) {
if (!plugin.hasWorldGuard()) return; if (!plugin.hasWorldGuard()) return;
for (Shop shop : plugin.getShopUtils().getShops()) { for (Shop shop : plugin.getShopUtils().getShopsCopy()) {
if (!shop.getLocation().getWorld().getName().equals(generalRegion.getWorldName())) continue; if (!shop.getLocation().getWorld().getName().equals(generalRegion.getWorldName())) continue;
for (IWrappedRegion r : WorldGuardWrapper.getInstance().getRegions(shop.getLocation())) { for (IWrappedRegion r : WorldGuardWrapper.getInstance().getRegions(shop.getLocation())) {