From 58d91342865ab2baf2a6c61f094a590b5cfcd2bd Mon Sep 17 00:00:00 2001 From: Leijurv Date: Mon, 26 Nov 2018 15:01:34 -0800 Subject: [PATCH] fix behavior around cocoa pods and vines, fixes #277 --- .../java/baritone/pathing/movement/MovementHelper.java | 3 ++- .../pathing/movement/movements/MovementDiagonal.java | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/baritone/pathing/movement/MovementHelper.java b/src/main/java/baritone/pathing/movement/MovementHelper.java index 581b0d0f..30f48b3b 100644 --- a/src/main/java/baritone/pathing/movement/MovementHelper.java +++ b/src/main/java/baritone/pathing/movement/MovementHelper.java @@ -70,7 +70,7 @@ public interface MovementHelper extends ActionCosts, Helper { if (block == Blocks.AIR) { // early return for most common case return true; } - if (block == Blocks.FIRE || block == Blocks.TRIPWIRE || block == Blocks.WEB || block == Blocks.END_PORTAL) { + if (block == Blocks.FIRE || block == Blocks.TRIPWIRE || block == Blocks.WEB || block == Blocks.END_PORTAL || block == Blocks.COCOA) { return false; } if (block instanceof BlockDoor || block instanceof BlockFenceGate) { @@ -139,6 +139,7 @@ public interface MovementHelper extends ActionCosts, Helper { || block == Blocks.WEB || block == Blocks.VINE || block == Blocks.LADDER + || block == Blocks.COCOA || block instanceof BlockDoor || block instanceof BlockFenceGate || block instanceof BlockSnow diff --git a/src/main/java/baritone/pathing/movement/movements/MovementDiagonal.java b/src/main/java/baritone/pathing/movement/movements/MovementDiagonal.java index 49385273..afe5a976 100644 --- a/src/main/java/baritone/pathing/movement/movements/MovementDiagonal.java +++ b/src/main/java/baritone/pathing/movement/movements/MovementDiagonal.java @@ -116,7 +116,8 @@ public class MovementDiagonal extends Movement { return COST_INF; } boolean water = false; - if (MovementHelper.isWater(context.getBlock(x, y, z)) || MovementHelper.isWater(destInto.getBlock())) { + Block startIn = context.getBlock(x, y, z); + if (MovementHelper.isWater(startIn) || MovementHelper.isWater(destInto.getBlock())) { // Ignore previous multiplier // Whatever we were walking on (possibly soul sand) doesn't matter as we're actually floating on water // Not even touching the blocks below @@ -125,6 +126,10 @@ public class MovementDiagonal extends Movement { } if (optionA != 0 || optionB != 0) { multiplier *= SQRT_2 - 0.001; // TODO tune + if (startIn == Blocks.LADDER || startIn == Blocks.VINE) { + // edging around doesn't work if doing so would climb a ladder or vine instead of moving sideways + return COST_INF; + } } if (context.canSprint() && !water) { // If we aren't edging around anything, and we aren't in water