Change isFlowing parameter to BlockPos for 1.13 changes

This commit is contained in:
Brady 2018-08-06 20:25:46 -05:00
parent e4492b654d
commit 67f5d22280
No known key found for this signature in database
GPG Key ID: 73A788379A197567
2 changed files with 4 additions and 2 deletions

View File

@ -59,7 +59,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(state) || BlockStateInterface.isLiquid(pos.up())) {
if (BlockStateInterface.isFlowing(pos) || BlockStateInterface.isLiquid(pos.up())) {
return false; // Don't walk through flowing liquids
}
return block.isPassable(mc.world, pos);

View File

@ -58,7 +58,9 @@ public class BlockStateInterface {
return BlockStateInterface.getBlock(p) instanceof BlockLiquid;
}
public static boolean isFlowing(IBlockState state) {
public static boolean isFlowing(BlockPos pos) {
// 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;