Fix FAWE using exclusive build height from PlotSquared (#2123)

Use inclusive build height maximum
This commit is contained in:
Hannes Greule 2023-03-02 00:47:28 +01:00 committed by GitHub
parent 6a31f4179c
commit 526e1902ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -158,8 +158,10 @@ public class PlotSquaredFeature extends FaweMaskManager {
Region maskedRegion; Region maskedRegion;
if (regions.size() == 1) { if (regions.size() == 1) {
int min = area != null ? area.getMinBuildHeight() : player.getWorld().getMinY(); final World world = player.getWorld();
int max = area != null ? Math.min(player.getWorld().getMaxY(), area.getMaxBuildHeight()) : player.getWorld().getMaxY(); 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 CuboidRegion region = regions.iterator().next();
final BlockVector3 pos1 = BlockVector3.at(region.getMinimumX(), min, region.getMinimumZ()); final BlockVector3 pos1 = BlockVector3.at(region.getMinimumX(), min, region.getMinimumZ());