fix: account for exclusivity of max build height where requires (#3935)

This commit is contained in:
Jordan 2023-01-16 21:15:35 +00:00 committed by GitHub
parent f6f00dfcda
commit 07e598e48f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -144,7 +144,7 @@ public class ClassicPlotManager extends SquarePlotManager {
plot.getRegions(), plot.getRegions(),
blocks, blocks,
classicPlotWorld.getMinBuildHeight(), classicPlotWorld.getMinBuildHeight(),
classicPlotWorld.getMaxBuildHeight(), classicPlotWorld.getMaxBuildHeight() - 1,
actor, actor,
queue queue
); );
@ -175,7 +175,7 @@ public class ClassicPlotManager extends SquarePlotManager {
plot.getRegions(), plot.getRegions(),
blocks, blocks,
classicPlotWorld.PLOT_HEIGHT + 1, classicPlotWorld.PLOT_HEIGHT + 1,
classicPlotWorld.getMaxBuildHeight(), classicPlotWorld.getMaxBuildHeight() - 1,
actor, actor,
queue queue
); );
@ -281,7 +281,7 @@ public class ClassicPlotManager extends SquarePlotManager {
} }
} }
int maxY = classicPlotWorld.getMaxBuildHeight(); int maxY = classicPlotWorld.getMaxBuildHeight() - 1;
if (!plot.isMerged(Direction.NORTH)) { if (!plot.isMerged(Direction.NORTH)) {
int z = bottom.getZ(); int z = bottom.getZ();
for (int x = bottom.getX(); x <= top.getX(); x++) { for (int x = bottom.getX(); x <= top.getX(); x++) {

View File

@ -2506,7 +2506,7 @@ public class Plot {
} }
} }
int minHeight = getArea().getMinBuildHeight(); int minHeight = getArea().getMinBuildHeight();
int maxHeight = getArea().getMaxBuildHeight(); int maxHeight = getArea().getMaxBuildHeight() - 1;
Location gtopabs = this.area.getPlotAbs(top).getTopAbs(); Location gtopabs = this.area.getPlotAbs(top).getTopAbs();
Location gbotabs = this.area.getPlotAbs(bot).getBottomAbs(); Location gbotabs = this.area.getPlotAbs(bot).getBottomAbs();
visited.addAll(Lists.newArrayList((Iterable<? extends PlotId>) PlotId.PlotRangeIterator.range(bot, top))); visited.addAll(Lists.newArrayList((Iterable<? extends PlotId>) PlotId.PlotRangeIterator.range(bot, top)));

View File

@ -106,7 +106,7 @@ public class WEManager {
.getTrusted().contains(uuid))) && !plot.getFlag(NoWorldeditFlag.class)) { .getTrusted().contains(uuid))) && !plot.getFlag(NoWorldeditFlag.class)) {
for (CuboidRegion region : plot.getRegions()) { for (CuboidRegion region : plot.getRegions()) {
BlockVector3 pos1 = region.getMinimumPoint().withY(area.getMinBuildHeight()); 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); CuboidRegion copy = new CuboidRegion(pos1, pos2);
regions.add(copy); regions.add(copy);
} }