don't start a path midair
This commit is contained in:
parent
d94e825a79
commit
ee8e44d314
@ -27,7 +27,9 @@ import baritone.bot.pathing.calc.IPathFinder;
|
|||||||
import baritone.bot.pathing.goals.Goal;
|
import baritone.bot.pathing.goals.Goal;
|
||||||
import baritone.bot.pathing.path.IPath;
|
import baritone.bot.pathing.path.IPath;
|
||||||
import baritone.bot.pathing.path.PathExecutor;
|
import baritone.bot.pathing.path.PathExecutor;
|
||||||
|
import baritone.bot.utils.BlockStateInterface;
|
||||||
import baritone.bot.utils.PathRenderer;
|
import baritone.bot.utils.PathRenderer;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
@ -92,7 +94,7 @@ public class PathingBehavior extends Behavior {
|
|||||||
// if we aren't calculating right now
|
// if we aren't calculating right now
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
findPathInNewThread(playerFeet(), true, Optional.empty());
|
findPathInNewThread(pathStart(), true, Optional.empty());
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -168,11 +170,19 @@ public class PathingBehavior extends Behavior {
|
|||||||
if (isPathCalcInProgress) {
|
if (isPathCalcInProgress) {
|
||||||
return;
|
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
|
* In a new thread, pathfind to target blockpos
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user