why do i even do this

This commit is contained in:
Leijurv 2018-09-22 19:48:33 -07:00
parent 3c4708fef7
commit 2d3cdddc51
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
1 changed files with 6 additions and 2 deletions

View File

@ -96,11 +96,12 @@ public class MovementAscend extends Movement {
return COST_INF;
}
}
IBlockState srcUp2 = null;
if (BlockStateInterface.get(x, y + 3, z).getBlock() instanceof BlockFalling) {//it would fall on us and possibly suffocate us
// HOWEVER, we assume that we're standing in the start position
// that means that src and src.up(1) are both air
// maybe they aren't now, but they will be by the time this starts
if (!(BlockStateInterface.getBlock(x, y + 1, z) instanceof BlockFalling) || !(BlockStateInterface.getBlock(x, y + 2, z) instanceof BlockFalling)) {
if (!(BlockStateInterface.getBlock(x, y + 1, z) instanceof BlockFalling) || !((srcUp2 = BlockStateInterface.get(x, y + 2, z)).getBlock() instanceof BlockFalling)) {
// if both of those are BlockFalling, that means that by standing on src
// (the presupposition of this Movement)
// we have necessarily already cleared the entire BlockFalling stack
@ -137,7 +138,10 @@ public class MovementAscend extends Movement {
if (hasToPlace) {
totalCost += context.placeBlockCost();
}
totalCost += MovementHelper.getMiningDurationTicks(context, x, y + 2, z, false); // TODO MAKE ABSOLUTELY SURE we don't need includeFalling here, from the falling check above
if (srcUp2 == null) {
srcUp2 = BlockStateInterface.get(x, y + 2, z);
}
totalCost += MovementHelper.getMiningDurationTicks(context, x, y + 2, z, srcUp2, false); // TODO MAKE ABSOLUTELY SURE we don't need includeFalling here, from the falling check above
if (totalCost >= COST_INF) {
return COST_INF;
}