maybe this will fix it

This commit is contained in:
Leijurv 2018-08-11 20:05:46 -07:00
parent 6480c8ce73
commit 816253cc87
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A

View File

@ -48,6 +48,8 @@ public class MovementDescend extends Movement {
return WALK_ONE_BLOCK_COST * 0.8 + Math.max(FALL_N_BLOCKS_COST[1], WALK_ONE_BLOCK_COST * 0.2) + getTotalHardnessOfBlocksToBreak(context.getToolSet()); return WALK_ONE_BLOCK_COST * 0.8 + Math.max(FALL_N_BLOCKS_COST[1], WALK_ONE_BLOCK_COST * 0.2) + getTotalHardnessOfBlocksToBreak(context.getToolSet());
} }
int numTicks = 0;
@Override @Override
public MovementState updateState(MovementState state) { public MovementState updateState(MovementState state) {
super.updateState(state); super.updateState(state);
@ -75,7 +77,7 @@ public class MovementDescend extends Movement {
double diffZ2 = player().posZ - (fakeDest.getZ() + 0.5); double diffZ2 = player().posZ - (fakeDest.getZ() + 0.5);
double d = Math.sqrt(diffX2 * diffX2 + diffZ2 * diffZ2); double d = Math.sqrt(diffX2 * diffX2 + diffZ2 * diffZ2);
MovementHelper.moveTowards(state, fakeDest); MovementHelper.moveTowards(state, fakeDest);
if (d <= ab) { if (d <= ab && numTicks++ < 10) {
state.setInput(InputOverrideHandler.Input.MOVE_FORWARD, false); state.setInput(InputOverrideHandler.Input.MOVE_FORWARD, false);
state.setInput(InputOverrideHandler.Input.MOVE_BACK, true); state.setInput(InputOverrideHandler.Input.MOVE_BACK, true);
} }