Fix the isFlowing check
This commit is contained in:
parent
5cd8a958e1
commit
9ce1b9250f
@ -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);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user