i literally hate magma

This commit is contained in:
Leijurv 2018-08-12 08:24:53 -07:00
parent df1f6da526
commit 462ac1b03a
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A

View File

@ -22,6 +22,7 @@ import baritone.bot.pathing.movement.Movement;
import baritone.bot.pathing.movement.MovementHelper;
import baritone.bot.pathing.movement.MovementState;
import baritone.bot.utils.BlockStateInterface;
import net.minecraft.block.BlockMagma;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
@ -76,6 +77,12 @@ public class MovementDiagonal extends Movement {
if (!MovementHelper.canWalkOn(positionsToPlace[0])) {
return COST_INF;
}
if (BlockStateInterface.get(positionsToBreak[2].down()).getBlock() instanceof BlockMagma) {
return COST_INF;
}
if (BlockStateInterface.get(positionsToBreak[4].down()).getBlock() instanceof BlockMagma) {
return COST_INF;
}
double optionA = MovementHelper.getMiningDurationTicks(context.getToolSet(), positionsToBreak[0]) + MovementHelper.getMiningDurationTicks(context.getToolSet(), positionsToBreak[1]);
double optionB = MovementHelper.getMiningDurationTicks(context.getToolSet(), positionsToBreak[2]) + MovementHelper.getMiningDurationTicks(context.getToolSet(), positionsToBreak[3]);
if (optionA != 0 && optionB != 0) {