diff --git a/src/main/java/baritone/bot/behavior/PathingBehavior.java b/src/main/java/baritone/bot/behavior/PathingBehavior.java index 66036e7d..8842f609 100644 --- a/src/main/java/baritone/bot/behavior/PathingBehavior.java +++ b/src/main/java/baritone/bot/behavior/PathingBehavior.java @@ -1,4 +1,11 @@ package baritone.bot.behavior; -public class PathingBehavior { +import baritone.bot.pathing.path.PathExecutor; + +public class PathingBehavior extends Behavior{ + public static final PathingBehavior INSTANCE=new PathingBehavior(); + private PathingBehavior(){} + + private PathExecutor current; + } diff --git a/src/main/java/baritone/bot/pathing/calc/AStarPathFinder.java b/src/main/java/baritone/bot/pathing/calc/AStarPathFinder.java index 1de816d0..3883eb6a 100644 --- a/src/main/java/baritone/bot/pathing/calc/AStarPathFinder.java +++ b/src/main/java/baritone/bot/pathing/calc/AStarPathFinder.java @@ -3,11 +3,12 @@ package baritone.bot.pathing.calc; //import baritone.Baritone; +import baritone.bot.pathing.calc.openset.BinaryHeapOpenSet; +import baritone.bot.pathing.calc.openset.IOpenSet; import baritone.bot.pathing.goals.Goal; import baritone.bot.pathing.movement.ActionCosts; import baritone.bot.pathing.movement.Movement; -import baritone.bot.pathing.calc.openset.BinaryHeapOpenSet; -import baritone.bot.pathing.calc.openset.IOpenSet; +import baritone.bot.pathing.path.IPath; import baritone.bot.utils.ToolSet; import net.minecraft.client.Minecraft; import net.minecraft.util.math.BlockPos; diff --git a/src/main/java/baritone/bot/pathing/calc/AbstractNodeCostSearch.java b/src/main/java/baritone/bot/pathing/calc/AbstractNodeCostSearch.java index 718157da..49619727 100644 --- a/src/main/java/baritone/bot/pathing/calc/AbstractNodeCostSearch.java +++ b/src/main/java/baritone/bot/pathing/calc/AbstractNodeCostSearch.java @@ -1,6 +1,7 @@ package baritone.bot.pathing.calc; import baritone.bot.pathing.goals.Goal; +import baritone.bot.pathing.path.IPath; import net.minecraft.util.math.BlockPos; import java.util.HashMap; diff --git a/src/main/java/baritone/bot/pathing/calc/IPathFinder.java b/src/main/java/baritone/bot/pathing/calc/IPathFinder.java index ab5ac11d..c661050b 100644 --- a/src/main/java/baritone/bot/pathing/calc/IPathFinder.java +++ b/src/main/java/baritone/bot/pathing/calc/IPathFinder.java @@ -1,6 +1,7 @@ package baritone.bot.pathing.calc; import baritone.bot.pathing.goals.Goal; +import baritone.bot.pathing.path.IPath; import net.minecraft.util.math.BlockPos; /** diff --git a/src/main/java/baritone/bot/pathing/calc/Path.java b/src/main/java/baritone/bot/pathing/calc/Path.java index ace92acf..d4c48284 100644 --- a/src/main/java/baritone/bot/pathing/calc/Path.java +++ b/src/main/java/baritone/bot/pathing/calc/Path.java @@ -1,7 +1,9 @@ package baritone.bot.pathing.calc; +import baritone.bot.pathing.calc.PathNode; import baritone.bot.pathing.goals.Goal; import baritone.bot.pathing.movement.Movement; +import baritone.bot.pathing.path.IPath; import net.minecraft.util.math.BlockPos; import java.util.*; diff --git a/src/main/java/baritone/bot/pathing/calc/IPath.java b/src/main/java/baritone/bot/pathing/path/IPath.java similarity index 98% rename from src/main/java/baritone/bot/pathing/calc/IPath.java rename to src/main/java/baritone/bot/pathing/path/IPath.java index 91354b51..0e0baeae 100644 --- a/src/main/java/baritone/bot/pathing/calc/IPath.java +++ b/src/main/java/baritone/bot/pathing/path/IPath.java @@ -1,4 +1,4 @@ -package baritone.bot.pathing.calc; +package baritone.bot.pathing.path; import baritone.bot.pathing.movement.Movement; import baritone.bot.utils.Utils; diff --git a/src/main/java/baritone/bot/behavior/PathExecution.java b/src/main/java/baritone/bot/pathing/path/PathExecutor.java similarity index 97% rename from src/main/java/baritone/bot/behavior/PathExecution.java rename to src/main/java/baritone/bot/pathing/path/PathExecutor.java index 461f3395..1184ef3b 100644 --- a/src/main/java/baritone/bot/behavior/PathExecution.java +++ b/src/main/java/baritone/bot/pathing/path/PathExecutor.java @@ -1,6 +1,6 @@ -package baritone.bot.behavior; +package baritone.bot.pathing.path; -import baritone.bot.pathing.calc.IPath; +import baritone.bot.behavior.Behavior; import baritone.bot.pathing.movement.ActionCosts; import baritone.bot.pathing.movement.Movement; import baritone.bot.pathing.movement.MovementState; @@ -19,7 +19,7 @@ import static baritone.bot.pathing.movement.MovementState.MovementStatus.*; * * @author leijurv */ -public class PathExecution extends Behavior { +public class PathExecutor extends Behavior { private static final double MAX_DIST_FROM_PATH = 2; private static final double MAX_TICKS_AWAY = 200; // ten seconds private final IPath path; @@ -28,7 +28,7 @@ public class PathExecution extends Behavior { private int ticksOnCurrent; private boolean failed; - public PathExecution(IPath path) { + public PathExecutor(IPath path) { this.path = path; this.pathPosition = 0; } diff --git a/src/test/java/baritone/bot/pathing/movement/ActionCostsButOnlyTheOnesThatMakeMickeyDieInsideTest.java b/src/test/java/baritone/bot/pathing/movement/ActionCostsButOnlyTheOnesThatMakeMickeyDieInsideTest.java index dbacebe8..7c54c848 100644 --- a/src/test/java/baritone/bot/pathing/movement/ActionCostsButOnlyTheOnesThatMakeMickeyDieInsideTest.java +++ b/src/test/java/baritone/bot/pathing/movement/ActionCostsButOnlyTheOnesThatMakeMickeyDieInsideTest.java @@ -12,7 +12,7 @@ public class ActionCostsButOnlyTheOnesThatMakeMickeyDieInsideTest { assertEquals(FALL_N_BLOCKS_COST.length, 257); // Fall 0 blocks through fall 256 blocks for (int i = 0; i < 257; i++) { double blocks = ticksToBlocks(FALL_N_BLOCKS_COST[i]); - assertEquals(blocks, i, 0.01); + assertEquals(blocks, i, 0.000000000001); // If you add another 0 the test fails at i=217 LOL } }