diff --git a/src/main/java/com/intellectualcrafters/plot/generator/HybridPlotManager.java b/src/main/java/com/intellectualcrafters/plot/generator/HybridPlotManager.java index ef4e0417b..ae0230912 100644 --- a/src/main/java/com/intellectualcrafters/plot/generator/HybridPlotManager.java +++ b/src/main/java/com/intellectualcrafters/plot/generator/HybridPlotManager.java @@ -91,12 +91,12 @@ public class HybridPlotManager extends ClassicPlotManager { public void createSchemAbs(HybridPlotWorld hpw, Location pos1, Location pos2, int height, boolean clear) { final int size = hpw.SIZE; for (int x = pos1.getX(); x <= pos2.getX(); x++) { + short absX = (short) ((x - hpw.ROAD_OFFSET_X) % size); + if (absX < 0) { + absX += size; + } for (int z = pos1.getZ(); z <= pos2.getZ(); z++) { - short absX = (short) (x % size); - short absZ = (short) (z % size); - if (absX < 0) { - absX += size; - } + short absZ = (short) ((z - hpw.ROAD_OFFSET_Z) % size); if (absZ < 0) { absZ += size; } @@ -171,9 +171,13 @@ public class HybridPlotManager extends ClassicPlotManager { public boolean clearPlot(final PlotWorld plotworld, final Plot plot, final boolean isDelete, final Runnable whenDone) { 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); + System.out.print(pos1); + System.out.print(pos2); + setWallFilling(dpw, plot.id, new PlotBlock[] { dpw.WALL_FILLING }); final int p1x = pos1.getX(); final int p1z = pos1.getZ(); @@ -261,7 +265,7 @@ public class HybridPlotManager extends ClassicPlotManager { if (!plotworld.PLOT_SCHEMATIC) { return; } - createSchemAbs(plotworld, l1.add(1,0,1), l2, plotworld.PLOT_HEIGHT, false); + createSchemAbs(plotworld, l1, l2, plotworld.PLOT_HEIGHT, false); } } diff --git a/src/main/java/com/intellectualcrafters/plot/listeners/PlotListener.java b/src/main/java/com/intellectualcrafters/plot/listeners/PlotListener.java index 25d0c4a2c..549c05808 100644 --- a/src/main/java/com/intellectualcrafters/plot/listeners/PlotListener.java +++ b/src/main/java/com/intellectualcrafters/plot/listeners/PlotListener.java @@ -202,7 +202,7 @@ public class PlotListener extends APlotListener { @Override public void run() { Plot lastPlot = (Plot) pp.getMeta("lastplot"); - if (plot.id.equals(lastPlot.id)) { + if (lastPlot != null && plot.id.equals(lastPlot.id)) { Map replacements = new HashMap<>(); replacements.put("%x%", lastPlot.id.x + ""); replacements.put("%z%", lastPlot.id.y + "");