From 5a573f52bf196fcdff1a6d343c03e3acb95a7d51 Mon Sep 17 00:00:00 2001 From: Howard Stark Date: Sat, 4 Aug 2018 23:01:38 -0400 Subject: [PATCH] Remove implementation of IMovement --- .../java/baritone/bot/pathing/movement/Movement.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/java/baritone/bot/pathing/movement/Movement.java b/src/main/java/baritone/bot/pathing/movement/Movement.java index 566c7e68..2e5b07e6 100644 --- a/src/main/java/baritone/bot/pathing/movement/Movement.java +++ b/src/main/java/baritone/bot/pathing/movement/Movement.java @@ -12,7 +12,7 @@ import net.minecraft.util.math.Vec3d; import java.util.Optional; -public abstract class Movement implements IMovement, Helper, MovementHelper { +public abstract class Movement implements Helper, MovementHelper { private MovementState currentState = new MovementState().setStatus(MovementStatus.PREPPING); protected final BlockPos src; @@ -45,6 +45,12 @@ public abstract class Movement implements IMovement, Helper, MovementHelper { public abstract double calculateCost(ToolSet ts); // TODO pass in information like whether it's allowed to place throwaway blocks + /** + * Handles the execution of the latest Movement + * State, and offers a Status to the calling class. + * + * @return Status + */ public MovementStatus update() { // if(isPrepared(state)) { // if (!currentState.isPresent()) { @@ -57,9 +63,9 @@ public abstract class Movement implements IMovement, Helper, MovementHelper { } MovementState latestState = updateState(currentState); - Tuple rotation = Utils.calcRotationFromVec3d(mc.player.getPositionEyes(1.0F), + Tuple rotation = Utils.calcRotationFromVec3d(player().getPositionEyes(1.0F), latestState.getGoal().rotation); - mc.player.setPositionAndRotation(mc.player.posX, mc.player.posY, mc.player.posZ, + player().setPositionAndRotation(player().posX, player().posY, player().posZ, rotation.getFirst(), rotation.getSecond()); //TODO calculate movement inputs from latestState.getGoal().position latestState.inputState.forEach((input, forced) -> {