must use 0.5 instead of bounding box center for descending ladders

This commit is contained in:
Leijurv 2018-08-06 20:52:19 -07:00
parent 9e8154dd5e
commit d0708992d4
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A

View File

@ -5,7 +5,10 @@ import baritone.bot.InputOverrideHandler;
import baritone.bot.behavior.impl.LookBehavior;
import baritone.bot.behavior.impl.LookBehaviorUtils;
import baritone.bot.pathing.movement.MovementState.MovementStatus;
import baritone.bot.utils.*;
import baritone.bot.utils.Helper;
import baritone.bot.utils.Rotation;
import baritone.bot.utils.ToolSet;
import baritone.bot.utils.Utils;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
@ -219,7 +222,7 @@ public abstract class Movement implements Helper, MovementHelper {
}
protected void moveTowards(BlockPos pos) {
currentState.setTarget(new MovementState.MovementTarget(new Rotation(Utils.calcRotationFromVec3d(playerHead(), Utils.calcCenterFromCoords(pos, world()), playerRotations()).getFirst(), player().rotationPitch)))
currentState.setTarget(new MovementState.MovementTarget(new Rotation(Utils.calcRotationFromVec3d(playerHead(), new Vec3d(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5), playerRotations()).getFirst(), player().rotationPitch)))
.setInput(InputOverrideHandler.Input.MOVE_FORWARD, true);
}
}