From 4c980df1d95ad9ef9b8c59930e9d3a992995c43a Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Sun, 15 Jan 2023 17:36:02 +0000 Subject: [PATCH] fix: account for exclusivity of max build height where requires - Fixes #3926 --- .../com/plotsquared/core/generator/ClassicPlotManager.java | 6 +++--- Core/src/main/java/com/plotsquared/core/plot/Plot.java | 2 +- Core/src/main/java/com/plotsquared/core/util/WEManager.java | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) 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 f7037cc24..c9eeb4485 100644 --- a/Core/src/main/java/com/plotsquared/core/generator/ClassicPlotManager.java +++ b/Core/src/main/java/com/plotsquared/core/generator/ClassicPlotManager.java @@ -144,7 +144,7 @@ public class ClassicPlotManager extends SquarePlotManager { plot.getRegions(), blocks, classicPlotWorld.getMinBuildHeight(), - classicPlotWorld.getMaxBuildHeight(), + classicPlotWorld.getMaxBuildHeight() - 1, actor, queue ); @@ -175,7 +175,7 @@ public class ClassicPlotManager extends SquarePlotManager { plot.getRegions(), blocks, classicPlotWorld.PLOT_HEIGHT + 1, - classicPlotWorld.getMaxBuildHeight(), + classicPlotWorld.getMaxBuildHeight() - 1, actor, queue ); @@ -281,7 +281,7 @@ public class ClassicPlotManager extends SquarePlotManager { } } - int maxY = classicPlotWorld.getMaxBuildHeight(); + int maxY = classicPlotWorld.getMaxBuildHeight() - 1; if (!plot.isMerged(Direction.NORTH)) { int z = bottom.getZ(); for (int x = bottom.getX(); x <= top.getX(); x++) { 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 5c90c2fad..b1c7c1f6a 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/Plot.java +++ b/Core/src/main/java/com/plotsquared/core/plot/Plot.java @@ -2506,7 +2506,7 @@ public class Plot { } } int minHeight = getArea().getMinBuildHeight(); - int maxHeight = getArea().getMaxBuildHeight(); + int maxHeight = getArea().getMaxBuildHeight() - 1; Location gtopabs = this.area.getPlotAbs(top).getTopAbs(); Location gbotabs = this.area.getPlotAbs(bot).getBottomAbs(); visited.addAll(Lists.newArrayList((Iterable) PlotId.PlotRangeIterator.range(bot, top))); diff --git a/Core/src/main/java/com/plotsquared/core/util/WEManager.java b/Core/src/main/java/com/plotsquared/core/util/WEManager.java index 78a3ff8ac..377160114 100644 --- a/Core/src/main/java/com/plotsquared/core/util/WEManager.java +++ b/Core/src/main/java/com/plotsquared/core/util/WEManager.java @@ -106,7 +106,7 @@ public class WEManager { .getTrusted().contains(uuid))) && !plot.getFlag(NoWorldeditFlag.class)) { for (CuboidRegion region : plot.getRegions()) { BlockVector3 pos1 = region.getMinimumPoint().withY(area.getMinBuildHeight()); - BlockVector3 pos2 = region.getMaximumPoint().withY(area.getMaxBuildHeight()); + BlockVector3 pos2 = region.getMaximumPoint().withY(area.getMaxBuildHeight() - 1); CuboidRegion copy = new CuboidRegion(pos1, pos2); regions.add(copy); }