diff --git a/Minebot/src/main/java/net/famzangl/minecraft/minebot/ai/path/FillAreaPathfinder.java b/Minebot/src/main/java/net/famzangl/minecraft/minebot/ai/path/FillAreaPathfinder.java index 72240f8..9ad65cd 100644 --- a/Minebot/src/main/java/net/famzangl/minecraft/minebot/ai/path/FillAreaPathfinder.java +++ b/Minebot/src/main/java/net/famzangl/minecraft/minebot/ai/path/FillAreaPathfinder.java @@ -20,6 +20,7 @@ import net.famzangl.minecraft.minebot.ai.command.AICommandParameter.BlockFilter; import net.famzangl.minecraft.minebot.ai.path.world.BlockSet; import net.famzangl.minecraft.minebot.ai.path.world.BlockSets; +import net.famzangl.minecraft.minebot.ai.path.world.WorldData; import net.famzangl.minecraft.minebot.ai.task.WaitTask; import net.famzangl.minecraft.minebot.ai.utils.BlockCuboid; import net.famzangl.minecraft.minebot.build.blockbuild.AbstractBuildTask; @@ -49,11 +50,11 @@ public boolean matches(BlockState block) { } - private final BlockCuboid fillCuboid; + private final BlockCuboid fillCuboid; private int currentFillLayer; private final BlockState blockToPlace; - public FillAreaPathfinder(BlockCuboid cuboid, + public FillAreaPathfinder(BlockCuboid cuboid, BlockState blockToPlace) { fillCuboid = cuboid; this.blockToPlace = blockToPlace; @@ -123,7 +124,11 @@ private boolean generatePlaceBlockTask(BlockPos currentPos) { BlockPos placeAtPos = currentPos.subtract(pos); if (placeAtPos.getY() == currentFillLayer && fillCuboid.contains(world, placeAtPos) - && BlockSets.AIR.isAt(world, placeAtPos)) { + && BlockSets.AIR.isAt(world, placeAtPos) + && BlockSets.AIR.isAt(world, placeAtPos.up()) + && BlockSets.AIR.isAt(world, placeAtPos.up(2)) + && BlockSets.safeSideAround(world, placeAtPos.up()) + && BlockSets.safeSideAround(world, placeAtPos.up(2))) { addTask(new BlockBuildTask(placeAtPos, blockToPlace) .getPlaceBlockTask(pos)); return true;