From 526e1902cac6601fc59a89c00168b78ff5f8480d Mon Sep 17 00:00:00 2001 From: Hannes Greule Date: Thu, 2 Mar 2023 00:47:28 +0100 Subject: [PATCH] Fix FAWE using exclusive build height from PlotSquared (#2123) Use inclusive build height maximum --- .../bukkit/regions/plotsquared/PlotSquaredFeature.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/PlotSquaredFeature.java b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/PlotSquaredFeature.java index f0a2c1ca2..34e5aeaaa 100644 --- a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/PlotSquaredFeature.java +++ b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/PlotSquaredFeature.java @@ -158,8 +158,10 @@ public class PlotSquaredFeature extends FaweMaskManager { Region maskedRegion; if (regions.size() == 1) { - int min = area != null ? area.getMinBuildHeight() : player.getWorld().getMinY(); - int max = area != null ? Math.min(player.getWorld().getMaxY(), area.getMaxBuildHeight()) : player.getWorld().getMaxY(); + final World world = player.getWorld(); + int min = area != null ? area.getMinBuildHeight() : world.getMinY(); + // PlotSquared uses exclusive max height, WorldEdit uses inclusive max height -> subtract 1 + int max = area != null ? Math.min(world.getMaxY(), area.getMaxBuildHeight() - 1) : world.getMaxY(); final CuboidRegion region = regions.iterator().next(); final BlockVector3 pos1 = BlockVector3.at(region.getMinimumX(), min, region.getMinimumZ());