Merge remote-tracking branch 'upstream/main'

This commit is contained in:
2023-04-11 11:58:22 +02:00
56 changed files with 8911 additions and 151 deletions

View File

@@ -145,6 +145,21 @@ public class FaweDelegateRegionManager {
editSession.setBlocks(fillingRegion, filling);
editSession.setBlocks(floorRegion, plotfloor);
editSession.setBlocks(airRegion, air);
if (hybridPlotWorld.getMinBuildHeight() < hybridPlotWorld.getMinGenHeight()) {
Region underneath = new CuboidRegion(
pos1.withY(hybridPlotWorld.getMinBuildHeight()),
pos2.withY(hybridPlotWorld.getMinGenHeight())
);
editSession.setBlocks(underneath, air);
}
if (hybridPlotWorld.getMaxGenHeight() < hybridPlotWorld.getMaxBuildHeight() - 1) {
Region onTop = new CuboidRegion(
pos1.withY(hybridPlotWorld.getMaxGenHeight()),
pos2.withY(hybridPlotWorld.getMaxBuildHeight() - 1)
);
editSession.setBlocks(onTop, air);
}
}
if (hybridPlotWorld.PLOT_SCHEMATIC) {

View File

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