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

Use inclusive build height maximum
Dieser Commit ist enthalten in:
Hannes Greule 2023-03-02 00:47:28 +01:00 committet von GitHub
Ursprung 6a31f4179c
Commit 526e1902ca
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -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());