From b5b7863d9a30db39eff4934e437fb904975d76d8 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Sat, 11 Aug 2018 18:05:55 -0700 Subject: [PATCH] this actually fixes breaking blocks --- .../java/baritone/bot/behavior/impl/LookBehaviorUtils.java | 4 ++-- src/main/java/baritone/bot/pathing/calc/AStarPathFinder.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/baritone/bot/behavior/impl/LookBehaviorUtils.java b/src/main/java/baritone/bot/behavior/impl/LookBehaviorUtils.java index 443b594e..424f179d 100644 --- a/src/main/java/baritone/bot/behavior/impl/LookBehaviorUtils.java +++ b/src/main/java/baritone/bot/behavior/impl/LookBehaviorUtils.java @@ -33,7 +33,7 @@ public final class LookBehaviorUtils implements Helper { /** * Offsets from the root block position to the center of each side. */ - private static final Vec3d[] BLOCK_SIDE_MULTIPLIERS = new Vec3d[] { + private static final Vec3d[] BLOCK_SIDE_MULTIPLIERS = new Vec3d[]{ new Vec3d(0.5, 0, 0.5), // Down new Vec3d(0.5, 1, 0.5), // Up new Vec3d(0.5, 0.5, 0), // North @@ -58,7 +58,7 @@ public final class LookBehaviorUtils implements Helper { public static Optional reachable(BlockPos pos) { if (pos.equals(getSelectedBlock().orElse(null))) { - return Optional.of(new Rotation(mc.player.rotationYaw, mc.player.rotationPitch)); + return Optional.of(new Rotation(mc.player.rotationYaw, mc.player.rotationPitch + 0.000001f)); } Optional possibleRotation = reachableCenter(pos); if (possibleRotation.isPresent()) diff --git a/src/main/java/baritone/bot/pathing/calc/AStarPathFinder.java b/src/main/java/baritone/bot/pathing/calc/AStarPathFinder.java index c7e1d4ef..8d7c0d1f 100644 --- a/src/main/java/baritone/bot/pathing/calc/AStarPathFinder.java +++ b/src/main/java/baritone/bot/pathing/calc/AStarPathFinder.java @@ -175,7 +175,7 @@ public class AStarPathFinder extends AbstractNodeCostSearch implements Helper { bestDist = dist; } if (dist > MIN_DIST_PATH * MIN_DIST_PATH) { // square the comparison since distFromStartSq is squared - System.out.println("A* cost coefficient " + COEFFICIENTS[i]); + displayChatMessageRaw("A* cost coefficient " + COEFFICIENTS[i]); if (COEFFICIENTS[i] >= 3) { System.out.println("Warning: cost coefficient is greater than three! Probably means that"); System.out.println("the path I found is pretty terrible (like sneak-bridging for dozens of blocks)"); @@ -186,7 +186,7 @@ public class AStarPathFinder extends AbstractNodeCostSearch implements Helper { return Optional.of(new Path(startNode, bestSoFar[i], goal, numNodes)); } } - System.out.println("Even with a cost coefficient of " + COEFFICIENTS[COEFFICIENTS.length - 1] + ", I couldn't get more than " + bestDist + " blocks =("); + displayChatMessageRaw("Even with a cost coefficient of " + COEFFICIENTS[COEFFICIENTS.length - 1] + ", I couldn't get more than " + bestDist + " blocks =("); displayChatMessageRaw("No path found =("); currentlyRunning = null; return Optional.empty();