From b97852dd6825c5edf37d2cd6266bb992d292d243 Mon Sep 17 00:00:00 2001 From: leijurv Date: Mon, 13 Aug 2018 20:09:27 -0700 Subject: [PATCH] vines patch tempfix --- .../baritone/bot/pathing/movement/Movement.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/main/java/baritone/bot/pathing/movement/Movement.java b/src/main/java/baritone/bot/pathing/movement/Movement.java index 1195905b..edcca086 100644 --- a/src/main/java/baritone/bot/pathing/movement/Movement.java +++ b/src/main/java/baritone/bot/pathing/movement/Movement.java @@ -21,10 +21,14 @@ import baritone.bot.Baritone; import baritone.bot.behavior.impl.LookBehavior; import baritone.bot.behavior.impl.LookBehaviorUtils; import baritone.bot.pathing.movement.MovementState.MovementStatus; +import baritone.bot.pathing.movement.movements.*; import baritone.bot.utils.BlockStateInterface; import baritone.bot.utils.Helper; import baritone.bot.utils.Rotation; 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.Vec3d; @@ -68,11 +72,21 @@ public abstract class Movement implements Helper, MovementHelper { if (cost == null) { if (context == null) context = new CalculationContext(); - cost = calculateCost(context); + cost = calculateCost0(context); } 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); public double recalculateCost() {