From 94e3b53f098f0cc04abf6b86d4276b8393f8e4cd Mon Sep 17 00:00:00 2001 From: Leijurv Date: Fri, 17 Aug 2018 12:29:30 -0700 Subject: [PATCH] added comments --- .../bot/pathing/movement/movements/MovementAscend.java | 4 ++++ .../bot/pathing/movement/movements/MovementPillar.java | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/main/java/baritone/bot/pathing/movement/movements/MovementAscend.java b/src/main/java/baritone/bot/pathing/movement/movements/MovementAscend.java index 51e9db3c..803c5d1c 100644 --- a/src/main/java/baritone/bot/pathing/movement/movements/MovementAscend.java +++ b/src/main/java/baritone/bot/pathing/movement/movements/MovementAscend.java @@ -98,6 +98,10 @@ public class MovementAscend extends Movement { // so don't do it return COST_INF; } + // you may think we only need to check srcUp2, not srcUp + // however, in the scenario where glitchy world gen where unsupported sand / gravel generates + // it's possible srcUp is AIR from the start, and srcUp2 is falling + // and in that scenario, when we arrive and break srcUp2, that lets srcUp3 fall on us and suffocate us } // TODO maybe change behavior if src.down() is soul sand? double walk = WALK_ONE_BLOCK_COST; diff --git a/src/main/java/baritone/bot/pathing/movement/movements/MovementPillar.java b/src/main/java/baritone/bot/pathing/movement/movements/MovementPillar.java index db858b25..95a836c5 100644 --- a/src/main/java/baritone/bot/pathing/movement/movements/MovementPillar.java +++ b/src/main/java/baritone/bot/pathing/movement/movements/MovementPillar.java @@ -65,6 +65,9 @@ public class MovementPillar extends Movement { BlockPos chkPos = src.up(3); IBlockState check = BlockStateInterface.get(chkPos); if (!MovementHelper.canWalkOn(chkPos, check) || MovementHelper.canWalkThrough(chkPos, check) || check.getBlock() instanceof BlockFalling) {//if the block above where we want to break is not a full block, don't do it + // TODO why does canWalkThrough mean this action is COST_INF? + // BlockFalling makes sense, and !canWalkOn deals with weird cases like if it were lava + // but I don't understand why canWalkThrough makes it impossible return COST_INF; } }