no more allowVines crash

This commit is contained in:
Leijurv 2019-10-09 10:48:14 -07:00
parent 0b2bab6549
commit ce2fc6f251
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
2 changed files with 5 additions and 1 deletions

View File

@ -195,7 +195,7 @@ public class MovementPillar extends Movement {
if (ladder) {
BlockPos against = vine ? getAgainst(new CalculationContext(baritone), src) : src.offset(fromDown.getValue(BlockLadder.FACING).getOpposite());
if (against == null) {
logDebug("Unable to climb vines");
logDirect("Unable to climb vines. Consider disabling allowVines.");
return state.setStatus(MovementStatus.UNREACHABLE);
}

View File

@ -261,6 +261,10 @@ public class MovementTraverse extends Movement {
BlockPos against = positionsToBreak[0];
if (feet.getY() != dest.getY() && ladder && (destDown.getBlock() == Blocks.VINE || destDown.getBlock() == Blocks.LADDER)) {
against = destDown.getBlock() == Blocks.VINE ? MovementPillar.getAgainst(new CalculationContext(baritone), dest.down()) : dest.offset(destDown.getValue(BlockLadder.FACING).getOpposite());
if (against == null) {
logDirect("Unable to climb vines. Consider disabling allowVines.");
return state.setStatus(MovementStatus.UNREACHABLE);
}
}
MovementHelper.moveTowards(ctx, state, against);
return state;