optim
This commit is contained in:
parent
24496d1de7
commit
0ba018388a
@ -83,7 +83,7 @@ public interface MovementHelper extends ActionCosts, Helper {
|
||||
|| block instanceof BlockTripWire) {//you can't actually walk through a lilypad from the side, and you shouldn't walk through fire
|
||||
return false;
|
||||
}
|
||||
if (BlockStateInterface.isFlowing(pos) || BlockStateInterface.isLiquid(pos.up())) {
|
||||
if (BlockStateInterface.isFlowing(state) || BlockStateInterface.isLiquid(pos.up())) {
|
||||
return false; // Don't walk through flowing liquids
|
||||
}
|
||||
return block.isPassable(mc.world, pos);
|
||||
|
@ -106,9 +106,8 @@ public class BlockStateInterface implements Helper {
|
||||
return BlockStateInterface.getBlock(p) instanceof BlockLiquid;
|
||||
}
|
||||
|
||||
public static boolean isFlowing(BlockPos pos) {
|
||||
public static boolean isFlowing(IBlockState state) {
|
||||
// Will be IFluidState in 1.13
|
||||
IBlockState state = BlockStateInterface.get(pos);
|
||||
return state.getBlock() instanceof BlockLiquid
|
||||
&& state.getPropertyKeys().contains(BlockLiquid.LEVEL)
|
||||
&& state.getValue(BlockLiquid.LEVEL) != 0;
|
||||
|
Loading…
Reference in New Issue
Block a user