diff --git a/Core/src/main/java/com/plotsquared/core/command/Save.java b/Core/src/main/java/com/plotsquared/core/command/Save.java index 45aa41af9..27c408e27 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Save.java +++ b/Core/src/main/java/com/plotsquared/core/command/Save.java @@ -104,8 +104,8 @@ public class Save extends SubCommand { TaskManager.runTaskAsync(() -> { String time = (System.currentTimeMillis() / 1000) + ""; Location[] corners = plot.getCorners(); - corners[0] = corners[0].withY(plot.getArea().getMinGenHeight()); - corners[1] = corners[1].withY(plot.getArea().getMaxGenHeight()); + corners[0] = corners[0].withY(plot.getArea().getMinBuildHeight()); + corners[1] = corners[1].withY(plot.getArea().getMaxBuildHeight()); int size = (corners[1].getX() - corners[0].getX()) + 1; PlotId id = plot.getId(); String world1 = plot.getArea().toString().replaceAll(";", "-") diff --git a/Core/src/main/java/com/plotsquared/core/generator/ClassicPlotManager.java b/Core/src/main/java/com/plotsquared/core/generator/ClassicPlotManager.java index 44d8e33c0..7957ac912 100644 --- a/Core/src/main/java/com/plotsquared/core/generator/ClassicPlotManager.java +++ b/Core/src/main/java/com/plotsquared/core/generator/ClassicPlotManager.java @@ -150,8 +150,8 @@ public class ClassicPlotManager extends SquarePlotManager { classicPlotWorld, plot.getRegions(), blocks, - classicPlotWorld.getMinGenHeight() + (classicPlotWorld.PLOT_BEDROCK ? 1 : 0), - classicPlotWorld.getMaxGenHeight(), + classicPlotWorld.getMinBuildHeight(), + classicPlotWorld.getMaxBuildHeight(), actor, queue ); @@ -182,7 +182,7 @@ public class ClassicPlotManager extends SquarePlotManager { plot.getRegions(), blocks, classicPlotWorld.PLOT_HEIGHT + 1, - classicPlotWorld.getMaxGenHeight(), + classicPlotWorld.getMaxBuildHeight(), actor, queue ); @@ -211,7 +211,7 @@ public class ClassicPlotManager extends SquarePlotManager { classicPlotWorld, plot.getRegions(), blocks, - classicPlotWorld.getMinGenHeight() + (classicPlotWorld.PLOT_BEDROCK ? 1 : 0), + classicPlotWorld.getMinBuildHeight(), classicPlotWorld.PLOT_HEIGHT - 1, actor, queue @@ -288,7 +288,7 @@ public class ClassicPlotManager extends SquarePlotManager { } } - int maxY = classicPlotWorld.getMaxGenHeight(); + int maxY = classicPlotWorld.getMaxBuildHeight(); if (!plot.isMerged(Direction.NORTH)) { int z = bottom.getZ(); for (int x = bottom.getX(); x <= top.getX(); x++) { @@ -386,11 +386,10 @@ public class ClassicPlotManager extends SquarePlotManager { } } - int startYOffset = classicPlotWorld.PLOT_BEDROCK ? 1 : 0; if (!plot.isMerged(Direction.NORTH)) { int z = bot.getZ(); for (int x = bot.getX(); x < top.getX(); x++) { - for (int y = classicPlotWorld.getMinGenHeight() + startYOffset; y <= classicPlotWorld.WALL_HEIGHT; y++) { + for (int y = classicPlotWorld.getMaxBuildHeight(); y <= classicPlotWorld.WALL_HEIGHT; y++) { queue.setBlock(x, y, z, blocks); } } @@ -398,7 +397,7 @@ public class ClassicPlotManager extends SquarePlotManager { if (!plot.isMerged(Direction.WEST)) { int x = bot.getX(); for (int z = bot.getZ(); z < top.getZ(); z++) { - for (int y = classicPlotWorld.getMinGenHeight() + startYOffset; y <= classicPlotWorld.WALL_HEIGHT; y++) { + for (int y = classicPlotWorld.getMinBuildHeight(); y <= classicPlotWorld.WALL_HEIGHT; y++) { queue.setBlock(x, y, z, blocks); } } @@ -406,7 +405,7 @@ public class ClassicPlotManager extends SquarePlotManager { if (!plot.isMerged(Direction.SOUTH)) { int z = top.getZ(); for (int x = bot.getX(); x < top.getX() + (plot.isMerged(Direction.EAST) ? 0 : 1); x++) { - for (int y = classicPlotWorld.getMinGenHeight() + startYOffset; y <= classicPlotWorld.WALL_HEIGHT; y++) { + for (int y = classicPlotWorld.getMinBuildHeight(); y <= classicPlotWorld.WALL_HEIGHT; y++) { queue.setBlock(x, y, z, blocks); } } @@ -414,7 +413,7 @@ public class ClassicPlotManager extends SquarePlotManager { if (!plot.isMerged(Direction.EAST)) { int x = top.getX(); for (int z = bot.getZ(); z < top.getZ() + (plot.isMerged(Direction.SOUTH) ? 0 : 1); z++) { - for (int y = classicPlotWorld.getMinGenHeight() + startYOffset; y <= classicPlotWorld.WALL_HEIGHT; y++) { + for (int y = classicPlotWorld.getMinBuildHeight(); y <= classicPlotWorld.WALL_HEIGHT; y++) { queue.setBlock(x, y, z, blocks); } } diff --git a/Core/src/main/java/com/plotsquared/core/plot/Plot.java b/Core/src/main/java/com/plotsquared/core/plot/Plot.java index 300c25ecf..1fa1e0aad 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/Plot.java +++ b/Core/src/main/java/com/plotsquared/core/plot/Plot.java @@ -2438,8 +2438,8 @@ public class Plot { return regions_cache; } if (!this.isMerged()) { - Location pos1 = this.getBottomAbs(); - Location pos2 = this.getTopAbs(); + Location pos1 = this.getBottomAbs().withY(getArea().getMinBuildHeight()); + Location pos2 = this.getTopAbs().withY(getArea().getMaxBuildHeight()); connected_cache = Sets.newHashSet(this); CuboidRegion rg = new CuboidRegion(pos1.getBlockVector3(), pos2.getBlockVector3()); regions_cache = Collections.singleton(rg); diff --git a/Core/src/main/java/com/plotsquared/core/util/SchematicHandler.java b/Core/src/main/java/com/plotsquared/core/util/SchematicHandler.java index 7c4b9bc07..03cb4c048 100644 --- a/Core/src/main/java/com/plotsquared/core/util/SchematicHandler.java +++ b/Core/src/main/java/com/plotsquared/core/util/SchematicHandler.java @@ -676,6 +676,7 @@ public abstract class SchematicHandler { final int minX = minimum.getX(); final int minZ = minimum.getZ(); final int minY = minimum.getY(); + System.out.println(minY); final int maxX = maximum.getX(); final int maxZ = maximum.getZ();