tiny optimization

This commit is contained in:
Leijurv 2018-09-24 13:13:24 -07:00
parent 812c23e1ca
commit 758e9c511a
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A

View File

@ -61,7 +61,8 @@ public class MovementDiagonal extends Movement {
if (fromDown == Blocks.LADDER || fromDown == Blocks.VINE) {
return COST_INF;
}
if (!MovementHelper.canWalkThrough(destX, y, destZ) || !MovementHelper.canWalkThrough(destX, y + 1, destZ)) {
IBlockState destInto = BlockStateInterface.get(destX, y, destZ);
if (!MovementHelper.canWalkThrough(destX, y, destZ, destInto) || !MovementHelper.canWalkThrough(destX, y + 1, destZ)) {
return COST_INF;
}
IBlockState destWalkOn = BlockStateInterface.get(destX, y - 1, destZ);
@ -103,7 +104,7 @@ public class MovementDiagonal extends Movement {
return COST_INF;
}
}
if (BlockStateInterface.isWater(BlockStateInterface.getBlock(x, y, z)) || BlockStateInterface.isWater(BlockStateInterface.getBlock(destX, y, destZ))) {
if (BlockStateInterface.isWater(BlockStateInterface.getBlock(x, y, z)) || BlockStateInterface.isWater(destInto.getBlock())) {
// Ignore previous multiplier
// Whatever we were walking on (possibly soul sand) doesn't matter as we're actually floating on water
// Not even touching the blocks below