vines patch tempfix

This commit is contained in:
leijurv 2018-08-13 20:09:27 -07:00
parent eee43ad5d1
commit b97852dd68

View File

@ -21,10 +21,14 @@ import baritone.bot.Baritone;
import baritone.bot.behavior.impl.LookBehavior; import baritone.bot.behavior.impl.LookBehavior;
import baritone.bot.behavior.impl.LookBehaviorUtils; import baritone.bot.behavior.impl.LookBehaviorUtils;
import baritone.bot.pathing.movement.MovementState.MovementStatus; import baritone.bot.pathing.movement.MovementState.MovementStatus;
import baritone.bot.pathing.movement.movements.*;
import baritone.bot.utils.BlockStateInterface; import baritone.bot.utils.BlockStateInterface;
import baritone.bot.utils.Helper; import baritone.bot.utils.Helper;
import baritone.bot.utils.Rotation; import baritone.bot.utils.Rotation;
import baritone.bot.utils.ToolSet; import baritone.bot.utils.ToolSet;
import net.minecraft.block.Block;
import net.minecraft.block.BlockLadder;
import net.minecraft.block.BlockVine;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3d;
@ -68,11 +72,21 @@ public abstract class Movement implements Helper, MovementHelper {
if (cost == null) { if (cost == null) {
if (context == null) if (context == null)
context = new CalculationContext(); context = new CalculationContext();
cost = calculateCost(context); cost = calculateCost0(context);
} }
return cost; return cost;
} }
private double calculateCost0(CalculationContext context){
if (!(this instanceof MovementPillar) && !(this instanceof MovementTraverse) && !(this instanceof MovementDownward)) {
Block fromDown = BlockStateInterface.get(src.down()).getBlock();
if (fromDown instanceof BlockLadder || fromDown instanceof BlockVine) {
return COST_INF;
}
}
return calculateCost(context);
}
protected abstract double calculateCost(CalculationContext context); protected abstract double calculateCost(CalculationContext context);
public double recalculateCost() { public double recalculateCost() {