unscuff water, thanks wwe

This commit is contained in:
Leijurv 2019-03-12 23:08:06 -07:00
parent 1ea92a6092
commit 4d22c10ddb
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
1 changed files with 5 additions and 4 deletions

View File

@ -122,7 +122,7 @@ public class MovementDescend extends Movement {
// and potentially replace the water we're going to fall into
return false;
}
if (!MovementHelper.canWalkThrough(context.bsi, destX, y - 2, destZ, below) && below.getBlock() != Blocks.WATER) {
if (!MovementHelper.canWalkThrough(context.bsi, destX, y - 2, destZ, below)) {
return false;
}
double costSoFar = 0;
@ -137,9 +137,10 @@ public class MovementDescend extends Movement {
IBlockState ontoBlock = context.get(destX, newY, destZ);
int unprotectedFallHeight = fallHeight - (y - effectiveStartHeight); // equal to fallHeight - y + effectiveFallHeight, which is equal to -newY + effectiveFallHeight, which is equal to effectiveFallHeight - newY
double tentativeCost = WALK_OFF_BLOCK_COST + FALL_N_BLOCKS_COST[unprotectedFallHeight] + frontBreak + costSoFar;
if (MovementHelper.isWater(ontoBlock) && context.getBlock(destX, newY + 1, destZ) != Blocks.LILY_PAD) {
// lilypads are canWalkThrough, but we can't end a fall that should be broken by water if it's covered by a lilypad
// however, don't return impossible in the lilypad scenario, because we could still jump right on it (water that's below a lilypad is canWalkOn so it works)
if (MovementHelper.isWater(ontoBlock)) {
if (!MovementHelper.canWalkThrough(context.bsi, destX, newY, destZ, ontoBlock)) {
return false;
}
if (context.assumeWalkOnWater) {
return false; // TODO fix
}