update logic
This commit is contained in:
parent
d4d2fb392a
commit
1dc0f5c3ad
@ -202,11 +202,13 @@ public interface MovementHelper extends ActionCosts, Helper {
|
||||
if (BlockStateInterface.isFlowing(state)) {
|
||||
return false;
|
||||
}
|
||||
if (Baritone.settings().assumeWalkOnWater.get()) {
|
||||
Block up = BlockStateInterface.get(pos.up()).getBlock();
|
||||
if (up instanceof BlockLilyPad) {
|
||||
return true;
|
||||
}
|
||||
Block up = BlockStateInterface.get(pos.up()).getBlock();
|
||||
return BlockStateInterface.isWater(up) || up instanceof BlockLilyPad; // You can only walk on water if there is water above it
|
||||
// if assumeWalkOnWater is on, we can only walk on water if there isn't water above it
|
||||
// if assumeWalkOnWater is off, we can only walk on water if there is water above it
|
||||
return BlockStateInterface.isWater(up) ^ Baritone.settings().assumeWalkOnWater.get();
|
||||
}
|
||||
if (Blocks.MAGMA.equals(block)) {
|
||||
return false;
|
||||
|
@ -105,12 +105,15 @@ public class MovementTraverse extends Movement {
|
||||
if (srcDown instanceof BlockLadder || srcDown instanceof BlockVine) {
|
||||
return COST_INF;
|
||||
}
|
||||
IBlockState pp0 = BlockStateInterface.get(positionsToPlace[0]);
|
||||
if (pp0.getBlock().equals(Blocks.AIR) || (!BlockStateInterface.isWater(pp0.getBlock()) && MovementHelper.isReplacable(positionsToPlace[0], pp0))) {
|
||||
if (destOn.getBlock().equals(Blocks.AIR) || MovementHelper.isReplacable(positionsToPlace[0], destOn)) {
|
||||
boolean throughWater = BlockStateInterface.isWater(pb0.getBlock()) || BlockStateInterface.isWater(pb1.getBlock());
|
||||
if (BlockStateInterface.isWater(destOn.getBlock()) && throughWater) {
|
||||
return COST_INF;
|
||||
}
|
||||
if (!context.hasThrowaway()) {
|
||||
return COST_INF;
|
||||
}
|
||||
double WC = BlockStateInterface.isWater(pb0.getBlock()) || BlockStateInterface.isWater(pb1.getBlock()) ? WALK_ONE_IN_WATER_COST : WALK_ONE_BLOCK_COST;
|
||||
double WC = throughWater ? WALK_ONE_IN_WATER_COST : WALK_ONE_BLOCK_COST;
|
||||
for (BlockPos against1 : against) {
|
||||
if (BlockStateInterface.get(against1).isBlockNormalCube()) {
|
||||
return WC + context.placeBlockCost() + getTotalHardnessOfBlocksToBreak(context);
|
||||
|
Loading…
Reference in New Issue
Block a user