From 166eb97c3fd882fd25cc14702bff0482b983887f Mon Sep 17 00:00:00 2001 From: Leijurv Date: Tue, 30 Apr 2019 16:52:27 -0700 Subject: [PATCH] make right click on arrival time out after 1 second --- src/main/java/baritone/process/GetToBlockProcess.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/baritone/process/GetToBlockProcess.java b/src/main/java/baritone/process/GetToBlockProcess.java index 0116df83..69703894 100644 --- a/src/main/java/baritone/process/GetToBlockProcess.java +++ b/src/main/java/baritone/process/GetToBlockProcess.java @@ -42,6 +42,7 @@ public class GetToBlockProcess extends BaritoneProcessHelper implements IGetToBl private BlockPos start; private int tickCount = 0; + private int arrivalTickCount = 0; public GetToBlockProcess(Baritone baritone) { super(baritone); @@ -53,6 +54,7 @@ public class GetToBlockProcess extends BaritoneProcessHelper implements IGetToBl gettingTo = block; start = ctx.playerFeet(); blacklist = new ArrayList<>(); + arrivalTickCount = 0; rescan(new ArrayList<>(), new CalculationContext(baritone)); } @@ -196,6 +198,10 @@ public class GetToBlockProcess extends BaritoneProcessHelper implements IGetToBl return true; } } + if (arrivalTickCount++ > 20) { + logDirect("Right click timed out"); + return true; + } return false; // trying to right click, will do it next tick or so } }