fix: switch to consistent heights for schematic generation

This commit is contained in:
dordsor21 2023-07-16 15:20:43 +01:00
parent f867867a42
commit 0a1faa0d04
No known key found for this signature in database
GPG Key ID: 1E53E88969FFCF0B
2 changed files with 6 additions and 11 deletions

View File

@ -275,7 +275,7 @@ public class HybridPlotWorld extends ClassicPlotWorld {
SCHEM_Y = getMinGenHeight(); SCHEM_Y = getMinGenHeight();
plotY = 0; plotY = 0;
} else if (!Settings.Schematics.PASTE_ON_TOP) { } else if (!Settings.Schematics.PASTE_ON_TOP) {
SCHEM_Y = getMinBuildHeight(); SCHEM_Y = getMinGenHeight();
plotY = 0; plotY = 0;
} }
maxSchematicHeight = plotY + plotSchemHeight; maxSchematicHeight = plotY + plotSchemHeight;
@ -296,20 +296,15 @@ public class HybridPlotWorld extends ClassicPlotWorld {
// Road is the lowest schematic. Normalize plotY to it. // Road is the lowest schematic. Normalize plotY to it.
if (Settings.Schematics.PASTE_ON_TOP) { if (Settings.Schematics.PASTE_ON_TOP) {
plotY = PLOT_HEIGHT - getMinGenHeight(); plotY = PLOT_HEIGHT - getMinGenHeight();
} else {
plotY = getMinBuildHeight() - getMinGenHeight();
} }
} }
} else if (!Settings.Schematics.PASTE_ROAD_ON_TOP) { } else if (!Settings.Schematics.PASTE_ROAD_ON_TOP) {
if (SCHEM_Y == getMinGenHeight()) { // Only possible if plot schematic is enabled roadY = 0;
// Plot is still the lowest schematic, normalize roadY to it SCHEM_Y = getMinGenHeight();
roadY = getMinBuildHeight() - getMinGenHeight(); if (schematic3 != null) {
} else if (schematic3 != null) {
SCHEM_Y = getMinBuildHeight();
roadY = 0;// Road is the lowest schematic
if (Settings.Schematics.PASTE_ON_TOP) { if (Settings.Schematics.PASTE_ON_TOP) {
// Road is the lowest schematic. Normalize plotY to it. // Road is the lowest schematic. Normalize plotY to it.
plotY = PLOT_HEIGHT - getMinBuildHeight(); plotY = PLOT_HEIGHT - SCHEM_Y;
} }
maxSchematicHeight = Math.max(maxSchematicHeight, plotY + plotSchemHeight); 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; 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 sx = bot.getX() - plotworld.ROAD_WIDTH + 1;
int sz = bot.getZ() + 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 ex = bot.getX();
int ez = top.getZ(); int ez = top.getZ();
int ey = get_ey(plotworld, queue, sx, ex, sz, ez, sy); int ey = get_ey(plotworld, queue, sx, ex, sz, ez, sy);