diff --git a/src/main/java/baritone/bot/behavior/impl/LookBehaviorUtils.java b/src/main/java/baritone/bot/behavior/impl/LookBehaviorUtils.java index 0d2ca2fc..443b594e 100644 --- a/src/main/java/baritone/bot/behavior/impl/LookBehaviorUtils.java +++ b/src/main/java/baritone/bot/behavior/impl/LookBehaviorUtils.java @@ -70,7 +70,7 @@ public final class LookBehaviorUtils implements Helper { double xDiff = aabb.minX * sideOffset.x + aabb.maxX * (1 - sideOffset.x); double yDiff = aabb.minY * sideOffset.y + aabb.maxY * (1 - sideOffset.y); double zDiff = aabb.minZ * sideOffset.z + aabb.maxZ * (1 - sideOffset.z); - possibleRotation = reachableRotation(pos, new Vec3d(pos).add(xDiff, yDiff, zDiff)); + possibleRotation = reachableOffset(pos, new Vec3d(pos).add(xDiff, yDiff, zDiff)); if (possibleRotation.isPresent()) return possibleRotation; } @@ -96,7 +96,7 @@ public final class LookBehaviorUtils implements Helper { * @param offsetPos * @return */ - protected static Optional reachableRotation(BlockPos pos, Vec3d offsetPos) { + protected static Optional reachableOffset(BlockPos pos, Vec3d offsetPos) { Rotation rotation = Utils.calcRotationFromVec3d(mc.player.getPositionEyes(1.0F), offsetPos); RayTraceResult result = rayTraceTowards(rotation); if (result != null @@ -113,13 +113,7 @@ public final class LookBehaviorUtils implements Helper { * @return */ protected static Optional reachableCenter(BlockPos pos) { - Rotation rotation = Utils.calcRotationFromVec3d(mc.player.getPositionEyes(1.0F), Utils.calcCenterFromCoords(pos, mc.world)); - RayTraceResult result = rayTraceTowards(rotation); - if (result != null - && result.typeOfHit == RayTraceResult.Type.BLOCK - && result.getBlockPos().equals(pos)) - return Optional.of(rotation); - return Optional.empty(); + return reachableOffset(pos, Utils.calcCenterFromCoords(pos, mc.world)); } /** diff --git a/src/main/java/baritone/bot/utils/Utils.java b/src/main/java/baritone/bot/utils/Utils.java index 16764e50..acad8c85 100755 --- a/src/main/java/baritone/bot/utils/Utils.java +++ b/src/main/java/baritone/bot/utils/Utils.java @@ -79,9 +79,11 @@ public final class Utils { double xDiff = (bbox.minX + bbox.maxX) / 2; double yDiff = (bbox.minY + bbox.maxY) / 2; double zDiff = (bbox.minZ + bbox.maxZ) / 2; - return new Vec3d(orig.getX() + xDiff, + return new Vec3d( + orig.getX() + xDiff, orig.getY() + yDiff, - orig.getZ() + zDiff); + orig.getZ() + zDiff + ); } public static Vec3d getBlockPosCenter(BlockPos pos) {