mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 21:26:45 +01:00
Experimental allow plot clearing on mega plots
This commit is contained in:
parent
c7f5e3061d
commit
3164838e05
@ -77,9 +77,9 @@ public class Clear extends SubCommand {
|
|||||||
MainUtil.sendMessage(plr, C.COMMAND_SYNTAX, "/plot clear [X;Z|mine]");
|
MainUtil.sendMessage(plr, C.COMMAND_SYNTAX, "/plot clear [X;Z|mine]");
|
||||||
return sendMessage(plr, C.NOT_IN_PLOT);
|
return sendMessage(plr, C.NOT_IN_PLOT);
|
||||||
}
|
}
|
||||||
if (!MainUtil.getTopPlot(plot).equals(MainUtil.getBottomPlot(plot))) {
|
// if (!MainUtil.getTopPlot(plot).equals(MainUtil.getBottomPlot(plot))) {
|
||||||
return sendMessage(plr, C.UNLINK_REQUIRED);
|
// return sendMessage(plr, C.UNLINK_REQUIRED);
|
||||||
}
|
// }
|
||||||
if (((plot == null) || !plot.hasOwner() || !plot.isOwner(UUIDHandler.getUUID(plr))) && !Permissions.hasPermission(plr, "plots.admin.command.clear")) {
|
if (((plot == null) || !plot.hasOwner() || !plot.isOwner(UUIDHandler.getUUID(plr))) && !Permissions.hasPermission(plr, "plots.admin.command.clear")) {
|
||||||
return sendMessage(plr, C.NO_PLOT_PERMS);
|
return sendMessage(plr, C.NO_PLOT_PERMS);
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,7 @@ import com.intellectualcrafters.plot.object.PlotBlock;
|
|||||||
import com.intellectualcrafters.plot.object.PlotId;
|
import com.intellectualcrafters.plot.object.PlotId;
|
||||||
import com.intellectualcrafters.plot.object.PlotLoc;
|
import com.intellectualcrafters.plot.object.PlotLoc;
|
||||||
import com.intellectualcrafters.plot.object.PlotWorld;
|
import com.intellectualcrafters.plot.object.PlotWorld;
|
||||||
|
import com.intellectualcrafters.plot.object.RegionWrapper;
|
||||||
import com.intellectualcrafters.plot.object.RunnableVal;
|
import com.intellectualcrafters.plot.object.RunnableVal;
|
||||||
import com.intellectualcrafters.plot.util.ChunkManager;
|
import com.intellectualcrafters.plot.util.ChunkManager;
|
||||||
import com.intellectualcrafters.plot.util.MainUtil;
|
import com.intellectualcrafters.plot.util.MainUtil;
|
||||||
@ -171,8 +172,8 @@ public class HybridPlotManager extends ClassicPlotManager {
|
|||||||
final String world = plotworld.worldname;
|
final String world = plotworld.worldname;
|
||||||
final HybridPlotWorld dpw = ((HybridPlotWorld) plotworld);
|
final HybridPlotWorld dpw = ((HybridPlotWorld) plotworld);
|
||||||
|
|
||||||
final Location pos1 = MainUtil.getPlotBottomLocAbs(world, plot.id).add(1, 0, 1);
|
final Location pos1 = MainUtil.getPlotBottomLoc(world, plot.id).add(1, 0, 1);
|
||||||
final Location pos2 = MainUtil.getPlotTopLocAbs(world, plot.id);
|
final Location pos2 = MainUtil.getPlotTopLoc(world, plot.id);
|
||||||
// If augmented
|
// If augmented
|
||||||
final boolean canRegen = plotworld.TYPE == 0 && plotworld.TERRAIN == 0;
|
final boolean canRegen = plotworld.TYPE == 0 && plotworld.TERRAIN == 0;
|
||||||
// The component blocks
|
// The component blocks
|
||||||
@ -186,7 +187,9 @@ public class HybridPlotManager extends ClassicPlotManager {
|
|||||||
public void run() {
|
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 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) {
|
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.manager.regenerateChunk(world, new ChunkLoc(value[0], value[1]));
|
||||||
|
ChunkManager.CURRENT_PLOT_CLEAR = null;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
Loading…
Reference in New Issue
Block a user