From e529438c7ef8f4f5593f6fbff6c41d2d81abdd71 Mon Sep 17 00:00:00 2001 From: ZacSharp <68165024+ZacSharp@users.noreply.github.com> Date: Wed, 14 Oct 2020 21:14:17 +0200 Subject: [PATCH] Don't use Abs on Sqrt --- src/api/java/baritone/api/pathing/goals/GoalNear.java | 2 +- src/api/java/baritone/api/pathing/goals/GoalRunAway.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/java/baritone/api/pathing/goals/GoalNear.java b/src/api/java/baritone/api/pathing/goals/GoalNear.java index 6f493fa5..c7e932e2 100644 --- a/src/api/java/baritone/api/pathing/goals/GoalNear.java +++ b/src/api/java/baritone/api/pathing/goals/GoalNear.java @@ -56,7 +56,7 @@ public class GoalNear implements Goal, IGoalRenderPos { @Override public double heuristic() {//TODO less hacky solution - int range = (int)Math.ceil(Math.abs(Math.sqrt(rangeSq))); + int range = (int)Math.ceil(Math.sqrt(rangeSq)); HashSet maybeAlwaysInside = new HashSet<>(); HashSet sometimesOutside = new HashSet<>(); for (int dx = -range; dx <= range; dx++) { diff --git a/src/api/java/baritone/api/pathing/goals/GoalRunAway.java b/src/api/java/baritone/api/pathing/goals/GoalRunAway.java index 76f7110c..9ee1b151 100644 --- a/src/api/java/baritone/api/pathing/goals/GoalRunAway.java +++ b/src/api/java/baritone/api/pathing/goals/GoalRunAway.java @@ -85,7 +85,7 @@ public class GoalRunAway implements Goal { @Override public double heuristic() {//TODO less hacky solution - int distance = (int)Math.ceil(Math.abs(Math.sqrt(distanceSq))); + int distance = (int)Math.ceil(Math.sqrt(distanceSq)); int minX = from[0].getX() - distance; int minY = from[0].getY() - distance; int minZ = from[0].getZ() - distance;