Fix plot clear event not being called.

This commit is contained in:
boy0001 2015-09-13 13:33:18 +10:00
parent 052019bb35
commit c163446f7e

View File

@ -1234,8 +1234,11 @@ public class MainUtil
return true; return true;
} }
public static void clear(final Plot plot, final boolean isDelete, final Runnable whenDone) public static boolean clear(final Plot plot, final boolean isDelete, final Runnable whenDone)
{ {
if (!EventUtil.manager.callClear(plot.world, plot.id)) {
return false;
}
final PlotManager manager = PS.get().getPlotManager(plot.world); final PlotManager manager = PS.get().getPlotManager(plot.world);
final Location pos1 = MainUtil.getPlotBottomLoc(plot.world, plot.id).add(1, 0, 1); final Location pos1 = MainUtil.getPlotBottomLoc(plot.world, plot.id).add(1, 0, 1);
final PlotWorld plotworld = PS.get().getPlotWorld(plot.world); final PlotWorld plotworld = PS.get().getPlotWorld(plot.world);
@ -1268,9 +1271,10 @@ public class MainUtil
{ {
final Location pos2 = MainUtil.getPlotTopLoc(plot.world, plot.id); final Location pos2 = MainUtil.getPlotTopLoc(plot.world, plot.id);
ChunkManager.manager.regenerateRegion(pos1, pos2, run); ChunkManager.manager.regenerateRegion(pos1, pos2, run);
return; return true;
} }
manager.clearPlot(plotworld, plot, run); manager.clearPlot(plotworld, plot, run);
return true;
} }
public static void setCuboid(final String world, final Location pos1, final Location pos2, final PlotBlock[] blocks) public static void setCuboid(final String world, final Location pos1, final Location pos2, final PlotBlock[] blocks)