This commit is contained in:
Leijurv 2018-08-13 13:32:10 -07:00
parent 40dfed7e9d
commit 5acb86e390
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
3 changed files with 3 additions and 4 deletions

View File

@ -86,7 +86,7 @@ public class MovementAscend extends Movement {
} }
double halfWalk = WALK_ONE_BLOCK_COST / 2; double halfWalk = WALK_ONE_BLOCK_COST / 2;
if (toPlace.getBlock().equals(Blocks.SOUL_SAND)) { if (toPlace.getBlock().equals(Blocks.SOUL_SAND)) {
halfWalk *= SNEAK_ONE_BLOCK_COST / WALK_ONE_BLOCK_COST; halfWalk *= WALK_ONE_IN_WATER_COST / WALK_ONE_BLOCK_COST;
} }
// we walk half the block to get to the edge, then we walk the other half while simultaneously jumping (math.max because of how it's in parallel) // we walk half the block to get to the edge, then we walk the other half while simultaneously jumping (math.max because of how it's in parallel)
return halfWalk + Math.max(JUMP_ONE_BLOCK_COST, halfWalk) + getTotalHardnessOfBlocksToBreak(context.getToolSet()); return halfWalk + Math.max(JUMP_ONE_BLOCK_COST, halfWalk) + getTotalHardnessOfBlocksToBreak(context.getToolSet());

View File

@ -48,7 +48,7 @@ public class MovementDescend extends Movement {
// we walk half the block plus 0.3 to get to the edge, then we walk the other 0.2 while simultaneously falling (math.max because of how it's in parallel) // we walk half the block plus 0.3 to get to the edge, then we walk the other 0.2 while simultaneously falling (math.max because of how it's in parallel)
double walk = WALK_OFF_BLOCK_COST; double walk = WALK_OFF_BLOCK_COST;
if (BlockStateInterface.get(src.down()).getBlock().equals(Blocks.SOUL_SAND)) { if (BlockStateInterface.get(src.down()).getBlock().equals(Blocks.SOUL_SAND)) {
walk *= WALK_ONE_BLOCK_COST / SNEAK_ONE_BLOCK_COST; walk *= WALK_ONE_IN_WATER_COST / WALK_ONE_BLOCK_COST;
} }
return walk + Math.max(FALL_N_BLOCKS_COST[1], CENTER_AFTER_FALL_COST) + getTotalHardnessOfBlocksToBreak(context.getToolSet()); return walk + Math.max(FALL_N_BLOCKS_COST[1], CENTER_AFTER_FALL_COST) + getTotalHardnessOfBlocksToBreak(context.getToolSet());
} }

View File

@ -74,8 +74,7 @@ public class MovementDiagonal extends Movement {
@Override @Override
protected double calculateCost(CalculationContext context) { protected double calculateCost(CalculationContext context) {
double lastPos = MovementHelper.getMiningDurationTicks(context.getToolSet(), positionsToBreak[4]) + MovementHelper.getMiningDurationTicks(context.getToolSet(), positionsToBreak[5]); if (!MovementHelper.canWalkThrough(positionsToBreak[4]) || !MovementHelper.canWalkThrough(positionsToBreak[5])) {
if (lastPos != 0) {
return COST_INF; return COST_INF;
} }
IBlockState destWalkOn = BlockStateInterface.get(positionsToPlace[0]); IBlockState destWalkOn = BlockStateInterface.get(positionsToPlace[0]);