From 06a4a1b7860f75dcbd03d819bf11e194b56e2d7c Mon Sep 17 00:00:00 2001 From: Raycoms Date: Sat, 18 Jul 2026 16:55:29 +0800 Subject: [PATCH 1/2] use same handle as solid substitution block --- .../handlers/placement/PlacementHandlers.java | 31 ++----------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/src/main/java/com/ldtteam/structurize/placement/handlers/placement/PlacementHandlers.java b/src/main/java/com/ldtteam/structurize/placement/handlers/placement/PlacementHandlers.java index e80e408d7..e1b7c70cd 100644 --- a/src/main/java/com/ldtteam/structurize/placement/handlers/placement/PlacementHandlers.java +++ b/src/main/java/com/ldtteam/structurize/placement/handlers/placement/PlacementHandlers.java @@ -349,22 +349,7 @@ public List getRequiredItems( if (!BlockUtils.isAnySolid(world.getBlockState(pos.below()))) { - BlockPos posBelow = pos; - BlockState supportBlockState = Blocks.DIRT instanceof Fallable ? Blocks.STONE.defaultBlockState() : Blocks.DIRT.defaultBlockState(); - for (int i = 0; i < 10; i++) // try up to ten blocks below for solid worldgen - { - posBelow = posBelow.below(); - final boolean isFirstTest = i == 0; - final BlockState possibleSupport = BlockUtils.getWorldgenBlock(world, posBelow, bp -> isFirstTest ? blockState : null); - if (possibleSupport != null && BlockUtils.canBlockFloatInAir(possibleSupport) && !canHandle(world, - posBelow, - possibleSupport)) - { - supportBlockState = possibleSupport; - break; - } - } - + BlockState supportBlockState = placementContext.getSolidBlockForPos(pos, placementContext.getBluePrint().getRawBlockStateFunction()); if (canHandle(world, pos, supportBlockState)) { Log.getLogger().warn("Unable to use: " + supportBlockState + " as support for a falling block, it is either a falling black itself or made fallable"); @@ -392,19 +377,7 @@ public ActionProcessingResult handle( if (!BlockUtils.isAnySolid(world.getBlockState(pos.below()))) { - BlockPos posBelow = pos; - BlockState supportBlockState = Blocks.DIRT.defaultBlockState(); - for (int i = 0; i < 10; i++) // try up to ten blocks below for solid worldgen - { - posBelow = posBelow.below(); - final boolean isFirstTest = i == 0; - final BlockState possibleSupport = BlockUtils.getWorldgenBlock(world, posBelow, bp -> isFirstTest ? blockState : null); - if (possibleSupport != null && BlockUtils.canBlockFloatInAir(possibleSupport)) - { - supportBlockState = possibleSupport; - break; - } - } + BlockState supportBlockState = placementContext.getSolidBlockForPos(pos, placementContext.getBluePrint().getRawBlockStateFunction()); world.setBlock(pos.below(), supportBlockState, UPDATE_FLAG); } if (!world.setBlock(pos, blockState, UPDATE_FLAG)) From 82d69923cf257cbae001ce4c980a0a3bf651d258 Mon Sep 17 00:00:00 2001 From: Raycoms Date: Sat, 18 Jul 2026 17:04:02 +0800 Subject: [PATCH 2/2] fix compile issues --- .../placement/BlockTagSubstitutionPlacementHandler.java | 4 ++-- .../placement/handlers/placement/DoBlockPlacementHandler.java | 2 +- .../handlers/placement/DoDoorBlockPlacementHandler.java | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/ldtteam/structurize/placement/handlers/placement/BlockTagSubstitutionPlacementHandler.java b/src/main/java/com/ldtteam/structurize/placement/handlers/placement/BlockTagSubstitutionPlacementHandler.java index d53798bab..81c425188 100644 --- a/src/main/java/com/ldtteam/structurize/placement/handlers/placement/BlockTagSubstitutionPlacementHandler.java +++ b/src/main/java/com/ldtteam/structurize/placement/handlers/placement/BlockTagSubstitutionPlacementHandler.java @@ -73,7 +73,7 @@ public ActionProcessingResult handle( world.setBlock(pos, blockState, UPDATE_FLAG); if (tileEntityData != null) { - handleTileEntityPlacement(tileEntityData, world, pos, placementContext.getRotationMirror()); + handleTileEntityPlacement(tileEntityData, world, pos, placementContext.getRotationMirror().getRotationMirror()); } return ActionProcessingResult.PASS; } @@ -85,7 +85,7 @@ public ActionProcessingResult handle( if (tileEntityData != null) { - handleTileEntityPlacement(tileEntityData, world, pos, placementContext.getRotationMirror()); + handleTileEntityPlacement(tileEntityData, world, pos, placementContext.getRotationMirror().getRotationMirror()); } } diff --git a/src/main/java/com/ldtteam/structurize/placement/handlers/placement/DoBlockPlacementHandler.java b/src/main/java/com/ldtteam/structurize/placement/handlers/placement/DoBlockPlacementHandler.java index c669e447b..4f2f7fb16 100644 --- a/src/main/java/com/ldtteam/structurize/placement/handlers/placement/DoBlockPlacementHandler.java +++ b/src/main/java/com/ldtteam/structurize/placement/handlers/placement/DoBlockPlacementHandler.java @@ -91,7 +91,7 @@ public ActionProcessingResult handle( { try { - handleTileEntityPlacement(tileEntityData, world, pos, placementContext.getRotationMirror()); + handleTileEntityPlacement(tileEntityData, world, pos, placementContext.getRotationMirror().getRotationMirror()); placementState.getBlock().setPlacedBy(world, pos, placementState, null, placementState.getBlock().getCloneItemStack(placementState, new BlockHitResult(new Vec3(0, 0, 0), Direction.NORTH, pos, false), world, pos, null)); } diff --git a/src/main/java/com/ldtteam/structurize/placement/handlers/placement/DoDoorBlockPlacementHandler.java b/src/main/java/com/ldtteam/structurize/placement/handlers/placement/DoDoorBlockPlacementHandler.java index 5e531f079..3cc41e027 100644 --- a/src/main/java/com/ldtteam/structurize/placement/handlers/placement/DoDoorBlockPlacementHandler.java +++ b/src/main/java/com/ldtteam/structurize/placement/handlers/placement/DoDoorBlockPlacementHandler.java @@ -57,8 +57,8 @@ public ActionProcessingResult handle( { try { - handleTileEntityPlacement(tileEntityData, world, pos, placementContext.getRotationMirror()); - handleTileEntityPlacement(tileEntityData, world, pos.above(), placementContext.getRotationMirror()); + handleTileEntityPlacement(tileEntityData, world, pos, placementContext.getRotationMirror().getRotationMirror()); + handleTileEntityPlacement(tileEntityData, world, pos.above(), placementContext.getRotationMirror().getRotationMirror()); } catch (final Exception ex) {