From aef84eceb8e5e3c581a6774feff0fa27fd307d3d Mon Sep 17 00:00:00 2001 From: Leijurv Date: Wed, 5 Jun 2019 14:26:26 -0700 Subject: [PATCH] fix a rare crash when the view is occluded by falling sand, fixes #443 --- .../baritone/pathing/movement/movements/MovementTraverse.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/baritone/pathing/movement/movements/MovementTraverse.java b/src/main/java/baritone/pathing/movement/movements/MovementTraverse.java index a9266f14..07eb20b7 100644 --- a/src/main/java/baritone/pathing/movement/movements/MovementTraverse.java +++ b/src/main/java/baritone/pathing/movement/movements/MovementTraverse.java @@ -169,6 +169,10 @@ public class MovementTraverse extends Movement { if (dist < 0.83) { return state; } + if (!state.getTarget().getRotation().isPresent()) { + // this can happen rarely when the server lags and doesn't send the falling sand entity until you've already walked through the block and are now mining the next one + return state; + } // combine the yaw to the center of the destination, and the pitch to the specific block we're trying to break // it's safe to do this since the two blocks we break (in a traverse) are right on top of each other and so will have the same yaw