From dffbb8e4c8fa97b0e33bad233e7f1f776d2f990f Mon Sep 17 00:00:00 2001 From: Brady Date: Thu, 27 Dec 2018 17:15:13 -0600 Subject: [PATCH] Overload reachable with IPlayerContext parameter --- src/api/java/baritone/api/utils/RotationUtils.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/api/java/baritone/api/utils/RotationUtils.java b/src/api/java/baritone/api/utils/RotationUtils.java index 0649ff10..9352b7fe 100644 --- a/src/api/java/baritone/api/utils/RotationUtils.java +++ b/src/api/java/baritone/api/utils/RotationUtils.java @@ -127,6 +127,16 @@ public final class RotationUtils { return new Vec3d((double) (f1 * f2), (double) f3, (double) (f * f2)); } + /** + * @param ctx Context for the viewing entity + * @param pos The target block position + * @return The optional rotation + * @see #reachable(EntityPlayerSP, BlockPos, double) + */ + public static Optional reachable(IPlayerContext ctx, BlockPos pos) { + return reachable(ctx.player(), pos, ctx.playerController().getBlockReachDistance()); + } + /** * Determines if the specified entity is able to reach the center of any of the sides * of the specified block. It first checks if the block center is reachable, and if so,