File tree Expand file tree Collapse file tree 3 files changed +10
-9
lines changed
Core/src/main/java/com/plotsquared/core/generator Expand file tree Collapse file tree 3 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -164,6 +164,9 @@ public int getMinComponentHeight() {
164164 : getMinBuildHeight ();
165165 }
166166
167+ /**
168+ * Get the lowest height of plot, road, and wall. Accounts for {@link Settings.Schematics#USE_WALL_IN_ROAD_SCHEM_HEIGHT}
169+ */
167170 int schematicStartHeight () {
168171 int plotRoadMin = Math .min (PLOT_HEIGHT , ROAD_HEIGHT );
169172 if (!Settings .Schematics .USE_WALL_IN_ROAD_SCHEM_HEIGHT ) {
Original file line number Diff line number Diff line change @@ -276,6 +276,7 @@ public void setupSchematics() throws SchematicHandler.UnsupportedFormatException
276276 SCHEM_Y = getMinGenHeight ();
277277 plotY = 0 ;
278278 } else if (!Settings .Schematics .PASTE_ON_TOP ) {
279+ // Schematics should generate/be pasted from build height
279280 SCHEM_Y = getMinBuildHeight ();
280281 plotY = 0 ;
281282 }
@@ -293,18 +294,14 @@ public void setupSchematics() throws SchematicHandler.UnsupportedFormatException
293294 roadY = 0 ; // Road is the lowest schematic
294295 if (schematic3 != null && schematic3 .getClipboard ().getDimensions ().getY () != worldGenHeight ) {
295296 // Road is the lowest schematic. Normalize plotY to it.
296- if (Settings .Schematics .PASTE_ON_TOP ) {
297- plotY = PLOT_HEIGHT - getMinGenHeight ();
298- }
297+ plotY = (Settings .Schematics .PASTE_ON_TOP ? PLOT_HEIGHT : getMinBuildHeight ()) - SCHEM_Y ;
299298 }
300299 } else if (!Settings .Schematics .PASTE_ROAD_ON_TOP ) {
301300 roadY = 0 ;
302301 SCHEM_Y = getMinGenHeight ();
303- if (schematic3 != null ) {
304- if (Settings .Schematics .PASTE_ON_TOP ) {
305- // Road is the lowest schematic. Normalize plotY to it.
306- plotY = PLOT_HEIGHT - SCHEM_Y ;
307- }
302+ if (schematic3 != null && schematic3 .getClipboard ().getDimensions ().getY () != worldGenHeight ) {
303+ // Road is the lowest schematic. Normalize plotY to it.
304+ plotY = (Settings .Schematics .PASTE_ON_TOP ? PLOT_HEIGHT : getMinBuildHeight ()) - SCHEM_Y ;
308305 }
309306 } else {
310307 roadY = minRoadWall - SCHEM_Y ;
Original file line number Diff line number Diff line change 6868import java .util .Iterator ;
6969import java .util .LinkedHashSet ;
7070import java .util .List ;
71+ import java .util .Objects ;
7172import java .util .Set ;
7273import java .util .concurrent .atomic .AtomicBoolean ;
7374import java .util .concurrent .atomic .AtomicInteger ;
@@ -529,7 +530,7 @@ public boolean setupRoadSchematic(Plot plot) {
529530 final QueueCoordinator queue = blockQueue .getNewQueue (worldUtil .getWeWorld (world ));
530531 Location bot = plot .getBottomAbs ().subtract (1 , 0 , 1 );
531532 Location top = plot .getTopAbs ();
532- final HybridPlotWorld plotworld = ( HybridPlotWorld ) plot .getArea ();
533+ final HybridPlotWorld plotworld = Objects . requireNonNull (( HybridPlotWorld ) plot .getArea () );
533534 // Do not use plotworld#schematicStartHeight() here as we want to restore the pre 6.1.4 way of doing it if
534535 // USE_WALL_IN_ROAD_SCHEM_HEIGHT is false
535536 int schemY = Settings .Schematics .USE_WALL_IN_ROAD_SCHEM_HEIGHT ?
You can’t perform that action at this time.
0 commit comments