From 3164838e053a41e0a920b83f73e7742f7467cefa Mon Sep 17 00:00:00 2001 From: boy0001 Date: Tue, 25 Aug 2015 03:07:09 +1000 Subject: [PATCH] Experimental allow plot clearing on mega plots --- .../java/com/intellectualcrafters/plot/commands/Clear.java | 6 +++--- .../plot/generator/HybridPlotManager.java | 7 +++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/intellectualcrafters/plot/commands/Clear.java b/src/main/java/com/intellectualcrafters/plot/commands/Clear.java index fdaf2ec9a..1828507e9 100644 --- a/src/main/java/com/intellectualcrafters/plot/commands/Clear.java +++ b/src/main/java/com/intellectualcrafters/plot/commands/Clear.java @@ -77,9 +77,9 @@ public class Clear extends SubCommand { MainUtil.sendMessage(plr, C.COMMAND_SYNTAX, "/plot clear [X;Z|mine]"); return sendMessage(plr, C.NOT_IN_PLOT); } - if (!MainUtil.getTopPlot(plot).equals(MainUtil.getBottomPlot(plot))) { - return sendMessage(plr, C.UNLINK_REQUIRED); - } +// if (!MainUtil.getTopPlot(plot).equals(MainUtil.getBottomPlot(plot))) { +// return sendMessage(plr, C.UNLINK_REQUIRED); +// } if (((plot == null) || !plot.hasOwner() || !plot.isOwner(UUIDHandler.getUUID(plr))) && !Permissions.hasPermission(plr, "plots.admin.command.clear")) { return sendMessage(plr, C.NO_PLOT_PERMS); } diff --git a/src/main/java/com/intellectualcrafters/plot/generator/HybridPlotManager.java b/src/main/java/com/intellectualcrafters/plot/generator/HybridPlotManager.java index 23a7bb392..69028dde3 100644 --- a/src/main/java/com/intellectualcrafters/plot/generator/HybridPlotManager.java +++ b/src/main/java/com/intellectualcrafters/plot/generator/HybridPlotManager.java @@ -37,6 +37,7 @@ import com.intellectualcrafters.plot.object.PlotBlock; import com.intellectualcrafters.plot.object.PlotId; import com.intellectualcrafters.plot.object.PlotLoc; import com.intellectualcrafters.plot.object.PlotWorld; +import com.intellectualcrafters.plot.object.RegionWrapper; import com.intellectualcrafters.plot.object.RunnableVal; import com.intellectualcrafters.plot.util.ChunkManager; import com.intellectualcrafters.plot.util.MainUtil; @@ -171,8 +172,8 @@ public class HybridPlotManager extends ClassicPlotManager { final String world = plotworld.worldname; final HybridPlotWorld dpw = ((HybridPlotWorld) plotworld); - final Location pos1 = MainUtil.getPlotBottomLocAbs(world, plot.id).add(1, 0, 1); - final Location pos2 = MainUtil.getPlotTopLocAbs(world, plot.id); + final Location pos1 = MainUtil.getPlotBottomLoc(world, plot.id).add(1, 0, 1); + final Location pos2 = MainUtil.getPlotTopLoc(world, plot.id); // If augmented final boolean canRegen = plotworld.TYPE == 0 && plotworld.TERRAIN == 0; // The component blocks @@ -186,7 +187,9 @@ public class HybridPlotManager extends ClassicPlotManager { public void run() { // If the chunk isn't near the edge and it isn't an augmented world we can just regen the whole chunk if (canRegen && value[6] == 0) { + ChunkManager.CURRENT_PLOT_CLEAR = new RegionWrapper(value[2], value[4], value[3], value[5]); ChunkManager.manager.regenerateChunk(world, new ChunkLoc(value[0], value[1])); + ChunkManager.CURRENT_PLOT_CLEAR = null; return; } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////