fix: switch to consistent heights for schematic generation (#4113)

This commit is contained in:
Jordan 2023-07-24 16:56:53 +01:00 committed by GitHub
parent 59be582c28
commit e0cb2949df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 11 deletions

View File

@ -275,7 +275,7 @@ public class HybridPlotWorld extends ClassicPlotWorld {
SCHEM_Y = getMinGenHeight();
plotY = 0;
} else if (!Settings.Schematics.PASTE_ON_TOP) {
SCHEM_Y = getMinBuildHeight();
SCHEM_Y = getMinGenHeight();
plotY = 0;
}
maxSchematicHeight = plotY + plotSchemHeight;
@ -296,20 +296,15 @@ public class HybridPlotWorld extends ClassicPlotWorld {
// Road is the lowest schematic. Normalize plotY to it.
if (Settings.Schematics.PASTE_ON_TOP) {
plotY = PLOT_HEIGHT - getMinGenHeight();
} else {
plotY = getMinBuildHeight() - getMinGenHeight();
}
}
} else if (!Settings.Schematics.PASTE_ROAD_ON_TOP) {
if (SCHEM_Y == getMinGenHeight()) { // Only possible if plot schematic is enabled
// Plot is still the lowest schematic, normalize roadY to it
roadY = getMinBuildHeight() - getMinGenHeight();
} else if (schematic3 != null) {
SCHEM_Y = getMinBuildHeight();
roadY = 0;// Road is the lowest schematic
roadY = 0;
SCHEM_Y = getMinGenHeight();
if (schematic3 != null) {
if (Settings.Schematics.PASTE_ON_TOP) {
// Road is the lowest schematic. Normalize plotY to it.
plotY = PLOT_HEIGHT - getMinBuildHeight();
plotY = PLOT_HEIGHT - SCHEM_Y;
}
maxSchematicHeight = Math.max(maxSchematicHeight, plotY + plotSchemHeight);
}

View File

@ -529,7 +529,7 @@ public class HybridUtils {
Math.min(plotworld.PLOT_HEIGHT, Math.min(plotworld.WALL_HEIGHT, plotworld.ROAD_HEIGHT)) : plotworld.ROAD_HEIGHT;
int sx = bot.getX() - plotworld.ROAD_WIDTH + 1;
int sz = bot.getZ() + 1;
int sy = Settings.Schematics.PASTE_ROAD_ON_TOP ? schemY : plot.getArea().getMinBuildHeight();
int sy = Settings.Schematics.PASTE_ROAD_ON_TOP ? schemY : plot.getArea().getMinGenHeight();
int ex = bot.getX();
int ez = top.getZ();
int ey = get_ey(plotworld, queue, sx, ex, sz, ez, sy);