From 04e8c5a8c47141a29f273ca20db91caa8ef02f56 Mon Sep 17 00:00:00 2001 From: boy0001 Date: Sat, 18 Oct 2014 15:49:08 +1100 Subject: [PATCH] added startMerge to plotManager --- .../src/com/intellectualcrafters/plot/PlotHelper.java | 4 +++- .../src/com/intellectualcrafters/plot/PlotManager.java | 4 ++++ .../com/intellectualcrafters/plot/commands/Unlink.java | 8 ++++++-- .../plot/generator/DefaultPlotManager.java | 10 ++++++++++ 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/PlotSquared/src/com/intellectualcrafters/plot/PlotHelper.java b/PlotSquared/src/com/intellectualcrafters/plot/PlotHelper.java index 4a5e1ef23..f3732dad3 100644 --- a/PlotSquared/src/com/intellectualcrafters/plot/PlotHelper.java +++ b/PlotSquared/src/com/intellectualcrafters/plot/PlotHelper.java @@ -100,7 +100,9 @@ public class PlotHelper { PlotManager manager = PlotMain.getPlotManager(world); PlotWorld plotworld = PlotMain.getWorldSettings(world); - + + manager.startPlotMerge(world, plotworld, plotIds); + for (int x = pos1.x; x <= pos2.x; x++) { for (int y = pos1.y; y <= pos2.y; y++) { diff --git a/PlotSquared/src/com/intellectualcrafters/plot/PlotManager.java b/PlotSquared/src/com/intellectualcrafters/plot/PlotManager.java index aca004e43..e7f8d29aa 100644 --- a/PlotSquared/src/com/intellectualcrafters/plot/PlotManager.java +++ b/PlotSquared/src/com/intellectualcrafters/plot/PlotManager.java @@ -60,6 +60,10 @@ public abstract class PlotManager { public abstract boolean removeRoadSouth(PlotWorld plotworld, Plot plot); public abstract boolean removeRoadSouthEast(PlotWorld plotworld, Plot plot); + + public abstract boolean startPlotMerge(World world, PlotWorld plotworld, ArrayList plotIds); + + public abstract boolean startPlotUnlink(World world, PlotWorld plotworld, ArrayList plotIds); public abstract boolean finishPlotMerge(World world, PlotWorld plotworld, ArrayList plotIds); diff --git a/PlotSquared/src/com/intellectualcrafters/plot/commands/Unlink.java b/PlotSquared/src/com/intellectualcrafters/plot/commands/Unlink.java index b58d894a7..a08112156 100644 --- a/PlotSquared/src/com/intellectualcrafters/plot/commands/Unlink.java +++ b/PlotSquared/src/com/intellectualcrafters/plot/commands/Unlink.java @@ -65,6 +65,11 @@ public class Unlink extends SubCommand { return false; } + PlotManager manager = PlotMain.getPlotManager(world); + PlotWorld plotworld = PlotMain.getWorldSettings(world); + + manager.startPlotUnlink(world, plotworld, ids); + for (PlotId id : ids) { Plot myplot = PlotMain.getPlots(world).get(id); @@ -78,8 +83,7 @@ public class Unlink extends SubCommand { myplot.settings.setMerged(new boolean[] { false, false, false, false }); DBFunc.setMerged(world.getName(), myplot, myplot.settings.getMerged()); } - PlotManager manager = PlotMain.getPlotManager(world); - PlotWorld plotworld = PlotMain.getWorldSettings(world); + for (int x = pos1.x; x <= pos2.x; x++) { for (int y = pos1.y; y <= pos2.y; y++) { boolean lx = x < pos2.x; diff --git a/PlotSquared/src/com/intellectualcrafters/plot/generator/DefaultPlotManager.java b/PlotSquared/src/com/intellectualcrafters/plot/generator/DefaultPlotManager.java index 1c5c1b4c1..4342fe6a6 100644 --- a/PlotSquared/src/com/intellectualcrafters/plot/generator/DefaultPlotManager.java +++ b/PlotSquared/src/com/intellectualcrafters/plot/generator/DefaultPlotManager.java @@ -602,4 +602,14 @@ public class DefaultPlotManager extends PlotManager { public boolean finishPlotUnlink(World world, PlotWorld plotworld, ArrayList plotIds) { return true; } + + @Override + public boolean startPlotMerge(World world, PlotWorld plotworld, ArrayList plotIds) { + return true; + } + + @Override + public boolean startPlotUnlink(World world, PlotWorld plotworld, ArrayList plotIds) { + return true; + } }