From c02d14dd43d362f1cc02e3ffa93ae4661fd8a3a0 Mon Sep 17 00:00:00 2001 From: Brianna Date: Tue, 24 Mar 2020 14:04:28 -0400 Subject: [PATCH] Fix for concurrent modification exception. --- .../com/songoda/ultimatekits/handlers/ParticleHandler.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/songoda/ultimatekits/handlers/ParticleHandler.java b/src/main/java/com/songoda/ultimatekits/handlers/ParticleHandler.java index 488654f..b56ca98 100644 --- a/src/main/java/com/songoda/ultimatekits/handlers/ParticleHandler.java +++ b/src/main/java/com/songoda/ultimatekits/handlers/ParticleHandler.java @@ -7,6 +7,7 @@ import com.songoda.ultimatekits.settings.Settings; import org.bukkit.Bukkit; import org.bukkit.Location; +import java.util.ArrayList; import java.util.Map; /** @@ -35,7 +36,7 @@ public class ParticleHandler { private void applyParticles() { Map kitBlocks = plugin.getKitManager().getKitLocations(); - for (KitBlockData kitBlockData : kitBlocks.values()) { + for (KitBlockData kitBlockData : new ArrayList<>(kitBlocks.values())) { if (kitBlockData.getLocation().getWorld() == null || !kitBlockData.hasParticles()) continue; Location location = kitBlockData.getLocation();