refactor
This commit is contained in:
parent
72c69eb962
commit
b1ced3fe84
@ -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;
|
||||
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
/**
|
||||
|
@ -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.*;
|
||||
|
@ -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;
|
@ -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;
|
||||
}
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user