more efficient check

This commit is contained in:
Leijurv 2018-08-28 11:57:31 -07:00
parent 01dbf75eca
commit 169eb1d0a3
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A

View File

@ -93,10 +93,15 @@ public interface MovementHelper extends ActionCosts, Helper {
return true; return true;
} }
} }
IBlockState up = BlockStateInterface.get(pos.up()); if (BlockStateInterface.isFlowing(state)) {
if (BlockStateInterface.isFlowing(state) || up.getBlock() instanceof BlockLiquid || up.getBlock() instanceof BlockLilyPad) {
return false; // Don't walk through flowing liquids return false; // Don't walk through flowing liquids
} }
if (block instanceof BlockLiquid) {
IBlockState up = BlockStateInterface.get(pos.up());
if (up.getBlock() instanceof BlockLiquid || up.getBlock() instanceof BlockLilyPad) {
return false;
}
}
return block.isPassable(mc.world, pos); return block.isPassable(mc.world, pos);
} }