Fix the isFlowing check

This commit is contained in:
Brady 2018-08-02 10:55:26 -07:00
parent 5cd8a958e1
commit 9ce1b9250f
No known key found for this signature in database
GPG Key ID: 73A788379A197567
1 changed files with 7 additions and 10 deletions

View File

@ -38,13 +38,10 @@ public interface ActionWorldHelper extends ActionCosts {
//return b != null && (waterFlowing.equals(b) || waterStill.equals(b) || lavaFlowing.equals(b) || lavaStill.equals(b));
}
static boolean isFlowing(BlockPos pos, IBlockState state) {
Block b = state.getBlock();
if (b instanceof BlockLiquid) {
System.out.println("Need to fix get flow check!!!");
//return BlockLiquid.getFlow(Minecraft.getMinecraft().world, pos, state) != -1000.0D;
}
return false;
static boolean isFlowing(IBlockState state) {
return state.getBlock() instanceof BlockLiquid
&& state.getPropertyKeys().contains(BlockLiquid.LEVEL)
&& state.getValue(BlockLiquid.LEVEL) != 0;
}
static boolean isLava(Block b) {
@ -79,11 +76,11 @@ public interface ActionWorldHelper extends ActionCosts {
if (block instanceof BlockLilyPad || block instanceof BlockFire) {//you can't actually walk through a lilypad from the side, and you shouldn't walk through fire
return false;
}
if (isFlowing(pos, state)) {
return false;//don't walk through flowing liquids
if (isFlowing(state)) {
return false; // Don't walk through flowing liquids
}
if (isLiquid(pos.up())) {
return false;//you could drown
return false; // You could drown
}
return block.isPassable(Minecraft.getMinecraft().world, pos);
}