From 30da060f8397bfbac3937e3509e20961b5ae17d4 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Tue, 16 Aug 2016 15:53:26 +1000 Subject: [PATCH] Potential fix for schematic placement on clear --- .../plot/generator/HybridPlotManager.java | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/Core/src/main/java/com/intellectualcrafters/plot/generator/HybridPlotManager.java b/Core/src/main/java/com/intellectualcrafters/plot/generator/HybridPlotManager.java index 2037d2bd1..f6dd0deec 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/generator/HybridPlotManager.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/generator/HybridPlotManager.java @@ -66,13 +66,14 @@ public class HybridPlotManager extends ClassicPlotManager { if (!hpw.ROAD_SCHEMATIC_ENABLED) { return true; } - createSchemAbs(hpw, pos1, pos2, true); + LocalBlockQueue queue = hpw.getQueue(false); + createSchemAbs(hpw, queue, pos1, pos2, true); + queue.enqueue(); return true; } - private void createSchemAbs(HybridPlotWorld hpw, Location pos1, Location pos2, boolean clear) { + private void createSchemAbs(HybridPlotWorld hpw, LocalBlockQueue queue, Location pos1, Location pos2, boolean clear) { int size = hpw.SIZE; - LocalBlockQueue queue = hpw.getQueue(false); for (int x = pos1.getX(); x <= pos2.getX(); x++) { short absX = (short) ((x - hpw.ROAD_OFFSET_X) % size); if (absX < 0) { @@ -96,7 +97,6 @@ public class HybridPlotManager extends ClassicPlotManager { } } } - queue.enqueue(); } @Override @@ -113,7 +113,9 @@ public class HybridPlotManager extends ClassicPlotManager { if (!hpw.ROAD_SCHEMATIC_ENABLED) { return true; } - createSchemAbs(hpw, pos1, pos2, true); + LocalBlockQueue queue = hpw.getQueue(false); + createSchemAbs(hpw, queue, pos1, pos2, true); + queue.enqueue(); return true; } @@ -127,11 +129,12 @@ public class HybridPlotManager extends ClassicPlotManager { Location pos2 = getPlotBottomLocAbs(hpw, id2); pos1.setY(0); pos2.setY(256); - createSchemAbs(hpw, pos1, pos2, true); - if (!hpw.ROAD_SCHEMATIC_ENABLED) { - return true; + LocalBlockQueue queue = hpw.getQueue(false); + createSchemAbs(hpw, queue, pos1, pos2, true); + if (hpw.ROAD_SCHEMATIC_ENABLED) { + createSchemAbs(hpw, queue, pos1, pos2, true); } - createSchemAbs(hpw, pos1, pos2, true); + queue.enqueue(); return true; } @@ -189,7 +192,7 @@ public class HybridPlotManager extends ClassicPlotManager { top.setY(256); queue.setCuboid(bot, top, air); // And finally set the schematic, the y value is unimportant for this function - pastePlotSchematic(dpw, bot, top); + pastePlotSchematic(dpw, queue, bot, top); } }, new Runnable() { @Override @@ -202,10 +205,10 @@ public class HybridPlotManager extends ClassicPlotManager { return true; } - public void pastePlotSchematic(HybridPlotWorld plotWorld, Location l1, Location l2) { + public void pastePlotSchematic(HybridPlotWorld plotWorld, LocalBlockQueue queue, Location l1, Location l2) { if (!plotWorld.PLOT_SCHEMATIC) { return; } - createSchemAbs(plotWorld, l1, l2, false); + createSchemAbs(plotWorld, queue, l1, l2, false); } }