mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 13:16:45 +01:00
fixed concurrentModificationException
This commit is contained in:
parent
7ce30ee955
commit
b4f987e470
@ -9,6 +9,7 @@
|
|||||||
package com.intellectualcrafters.plot;
|
package com.intellectualcrafters.plot;
|
||||||
|
|
||||||
import ca.mera.CameraAPI;
|
import ca.mera.CameraAPI;
|
||||||
|
|
||||||
import com.intellectualcrafters.plot.Logger.LogLevel;
|
import com.intellectualcrafters.plot.Logger.LogLevel;
|
||||||
import com.intellectualcrafters.plot.Settings.Web;
|
import com.intellectualcrafters.plot.Settings.Web;
|
||||||
import com.intellectualcrafters.plot.commands.Camera;
|
import com.intellectualcrafters.plot.commands.Camera;
|
||||||
@ -29,8 +30,10 @@ import com.intellectualcrafters.plot.uuid.PlotUUIDSaver;
|
|||||||
import com.intellectualcrafters.plot.uuid.UUIDSaver;
|
import com.intellectualcrafters.plot.uuid.UUIDSaver;
|
||||||
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
|
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
|
||||||
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
|
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
|
||||||
|
|
||||||
import me.confuser.barapi.BarAPI;
|
import me.confuser.barapi.BarAPI;
|
||||||
import net.milkbowl.vault.economy.Economy;
|
import net.milkbowl.vault.economy.Economy;
|
||||||
|
|
||||||
import org.bukkit.*;
|
import org.bukkit.*;
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
@ -426,6 +429,9 @@ public class PlotMain extends JavaPlugin {
|
|||||||
public void run() {
|
public void run() {
|
||||||
for (String world : getPlotWorldsString()) {
|
for (String world : getPlotWorldsString()) {
|
||||||
if (plots.containsKey(world)) {
|
if (plots.containsKey(world)) {
|
||||||
|
|
||||||
|
ArrayList<Plot> toDeletePlot = new ArrayList<Plot>();
|
||||||
|
|
||||||
for (Plot plot : plots.get(world).values()) {
|
for (Plot plot : plots.get(world).values()) {
|
||||||
if (plot.owner == null) {
|
if (plot.owner == null) {
|
||||||
continue;
|
continue;
|
||||||
@ -442,10 +448,13 @@ public class PlotMain extends JavaPlugin {
|
|||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
DBFunc.delete(world, plot);
|
toDeletePlot.add(plot);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (Plot plot: toDeletePlot) {
|
||||||
|
DBFunc.delete(world, plot);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user