Fix for concurrent modification exception.

This commit is contained in:
Brianna 2020-03-24 14:04:28 -04:00
parent a19ea735fa
commit c02d14dd43

View File

@ -7,6 +7,7 @@ import com.songoda.ultimatekits.settings.Settings;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
import java.util.ArrayList;
import java.util.Map; import java.util.Map;
/** /**
@ -35,7 +36,7 @@ public class ParticleHandler {
private void applyParticles() { private void applyParticles() {
Map<Location, KitBlockData> kitBlocks = plugin.getKitManager().getKitLocations(); Map<Location, KitBlockData> kitBlocks = plugin.getKitManager().getKitLocations();
for (KitBlockData kitBlockData : kitBlocks.values()) { for (KitBlockData kitBlockData : new ArrayList<>(kitBlocks.values())) {
if (kitBlockData.getLocation().getWorld() == null || !kitBlockData.hasParticles()) continue; if (kitBlockData.getLocation().getWorld() == null || !kitBlockData.hasParticles()) continue;
Location location = kitBlockData.getLocation(); Location location = kitBlockData.getLocation();