make right click on arrival time out after 1 second

This commit is contained in:
Leijurv 2019-04-30 16:52:27 -07:00
parent 920ce745c2
commit 166eb97c3f
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A

View File

@ -42,6 +42,7 @@ public class GetToBlockProcess extends BaritoneProcessHelper implements IGetToBl
private BlockPos start; private BlockPos start;
private int tickCount = 0; private int tickCount = 0;
private int arrivalTickCount = 0;
public GetToBlockProcess(Baritone baritone) { public GetToBlockProcess(Baritone baritone) {
super(baritone); super(baritone);
@ -53,6 +54,7 @@ public class GetToBlockProcess extends BaritoneProcessHelper implements IGetToBl
gettingTo = block; gettingTo = block;
start = ctx.playerFeet(); start = ctx.playerFeet();
blacklist = new ArrayList<>(); blacklist = new ArrayList<>();
arrivalTickCount = 0;
rescan(new ArrayList<>(), new CalculationContext(baritone)); rescan(new ArrayList<>(), new CalculationContext(baritone));
} }
@ -196,6 +198,10 @@ public class GetToBlockProcess extends BaritoneProcessHelper implements IGetToBl
return true; 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 return false; // trying to right click, will do it next tick or so
} }
} }