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) { 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 a158fcd4f..784f9b07b 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 @@ -350,22 +350,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"); @@ -393,19 +378,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()); handleBlockPlacement(world, pos.below(), supportBlockState); }