diff --git a/src/main/java/baritone/bot/behavior/impl/PathingBehavior.java b/src/main/java/baritone/bot/behavior/impl/PathingBehavior.java index 4bf49d971..b1f0be901 100644 --- a/src/main/java/baritone/bot/behavior/impl/PathingBehavior.java +++ b/src/main/java/baritone/bot/behavior/impl/PathingBehavior.java @@ -27,7 +27,9 @@ import baritone.bot.pathing.calc.IPathFinder; import baritone.bot.pathing.goals.Goal; import baritone.bot.pathing.path.IPath; import baritone.bot.pathing.path.PathExecutor; +import baritone.bot.utils.BlockStateInterface; import baritone.bot.utils.PathRenderer; +import net.minecraft.init.Blocks; import net.minecraft.util.math.BlockPos; import java.awt.*; @@ -92,7 +94,7 @@ public class PathingBehavior extends Behavior { // if we aren't calculating right now return; } - findPathInNewThread(playerFeet(), true, Optional.empty()); + findPathInNewThread(pathStart(), true, Optional.empty()); } return; } @@ -168,11 +170,19 @@ public class PathingBehavior extends Behavior { if (isPathCalcInProgress) { return; } - findPathInNewThread(playerFeet(), true, Optional.empty()); + findPathInNewThread(pathStart(), true, Optional.empty()); } } } + public BlockPos pathStart() { + BlockPos feet = playerFeet(); + if (BlockStateInterface.get(feet.down()).getBlock().equals(Blocks.AIR)) { + return feet.down(); + } + return feet; + } + /** * In a new thread, pathfind to target blockpos *