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

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)); //return b != null && (waterFlowing.equals(b) || waterStill.equals(b) || lavaFlowing.equals(b) || lavaStill.equals(b));
} }
static boolean isFlowing(BlockPos pos, IBlockState state) { static boolean isFlowing(IBlockState state) {
Block b = state.getBlock(); return state.getBlock() instanceof BlockLiquid
if (b instanceof BlockLiquid) { && state.getPropertyKeys().contains(BlockLiquid.LEVEL)
System.out.println("Need to fix get flow check!!!"); && state.getValue(BlockLiquid.LEVEL) != 0;
//return BlockLiquid.getFlow(Minecraft.getMinecraft().world, pos, state) != -1000.0D;
}
return false;
} }
static boolean isLava(Block b) { 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 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; return false;
} }
if (isFlowing(pos, state)) { if (isFlowing(state)) {
return false;//don't walk through flowing liquids return false; // Don't walk through flowing liquids
} }
if (isLiquid(pos.up())) { if (isLiquid(pos.up())) {
return false;//you could drown return false; // You could drown
} }
return block.isPassable(Minecraft.getMinecraft().world, pos); return block.isPassable(Minecraft.getMinecraft().world, pos);
} }