add BlockFalling check for MovementFall, fixes #94

This commit is contained in:
Leijurv 2018-08-25 17:09:35 -07:00
parent 85cf5322f9
commit f834bcec08
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A

View File

@ -30,6 +30,7 @@ import baritone.utils.InputOverrideHandler;
import baritone.utils.Rotation;
import baritone.utils.Utils;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFalling;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos;
@ -65,6 +66,9 @@ public class MovementFall extends Movement {
if (frontTwo >= COST_INF) {
return COST_INF;
}
if (BlockStateInterface.get(positionsToBreak[0].up()).getBlock() instanceof BlockFalling) {
return COST_INF;
}
for (int i = 2; i < positionsToBreak.length; i++) {
// TODO is this the right check here?
// miningDurationTicks is all right, but shouldn't it be canWalkThrough instead?