fix two weird ways of getting stuck

This commit is contained in:
Leijurv 2019-02-21 14:24:23 -08:00
parent e18dc7c7e7
commit 2b672998e1
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A

View File

@ -249,9 +249,9 @@ public class BuilderProcess extends BaritoneProcessHelper implements IBuilderPro
private static Vec3d[] aabbSideMultipliers(EnumFacing side) {
switch (side) {
case UP:
return new Vec3d[]{new Vec3d(0.5, 1, 0.5)};
return new Vec3d[]{new Vec3d(0.5, 1, 0.5), new Vec3d(0.1, 1, 0.5), new Vec3d(0.9, 1, 0.5), new Vec3d(0.5, 1, 0.1), new Vec3d(0.5, 1, 0.9)};
case DOWN:
return new Vec3d[]{new Vec3d(0.5, 0, 0.5)};
return new Vec3d[]{new Vec3d(0.5, 0, 0.5), new Vec3d(0.1, 0, 0.5), new Vec3d(0.9, 0, 0.5), new Vec3d(0.5, 0, 0.1), new Vec3d(0.5, 0, 0.9)};
case NORTH:
case SOUTH:
case EAST:
@ -295,6 +295,12 @@ public class BuilderProcess extends BaritoneProcessHelper implements IBuilderPro
BetterBlockPos pos = toBreak.get().getFirst();
baritone.getLookBehavior().updateTarget(rot, true);
MovementHelper.switchToBestToolFor(ctx, bcc.get(pos));
if (ctx.player().isSneaking()) {
// really horrible bug where a block is visible for breaking while sneaking but not otherwise
// so you can't see it, it goes to place something else, sneaks, then the next tick it tries to break
// and is unable since it's unsneaked in the intermediary tick
baritone.getInputOverrideHandler().setInputForceState(Input.SNEAK, true);
}
if (Objects.equals(ctx.objectMouseOver().getBlockPos(), pos) || ctx.playerRotations().isReallyCloseTo(rot)) {
baritone.getInputOverrideHandler().setInputForceState(Input.CLICK_LEFT, true);
}
@ -445,6 +451,11 @@ public class BuilderProcess extends BaritoneProcessHelper implements IBuilderPro
public double heuristic(int x, int y, int z) {
return primary.heuristic(x, y, z);
}
@Override
public String toString() {
return "JankyComposite Primary: " + primary + " Fallback: " + fallback;
}
}
public static class GoalBreak extends GoalGetToBlock {