Fix "Asynchronous block remove" issue

This commit is contained in:
boy0001 2015-01-04 15:41:00 +11:00
parent e876a93ef6
commit 55fe1c74c7
2 changed files with 14 additions and 8 deletions

View File

@ -544,14 +544,19 @@ import java.util.concurrent.TimeUnit;
}
}
for (final Plot plot : toDeletePlot) {
final World worldobj = Bukkit.getWorld(world);
PlotHelper.clear(worldobj, plot, true);
PlotHelper.removeSign(worldobj, plot);
DBFunc.delete(world, plot);
removePlot(world, plot.id, true);
if ((Math.abs(plot.id.x) < Math.abs(Auto.lastPlot.x)) && (Math.abs(plot.id.y) < Math.abs(Auto.lastPlot.y))) {
Auto.lastPlot = plot.id;
}
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
@Override
public void run() {
final World worldobj = Bukkit.getWorld(world);
PlotHelper.clear(worldobj, plot, true);
PlotHelper.removeSign(worldobj, plot);
DBFunc.delete(world, plot);
removePlot(world, plot.id, true);
if ((Math.abs(plot.id.x) < Math.abs(Auto.lastPlot.x)) && (Math.abs(plot.id.y) < Math.abs(Auto.lastPlot.y))) {
Auto.lastPlot = plot.id;
}
}
});
}
}
}

View File

@ -253,6 +253,7 @@ import java.util.Set;
if (!isPlotWorld(q)) {
if (isPlotWorld(f)) {
PWE.removeMask(p);
return;
} else {
return;
}