stop walking into liquids, fixes #155

This commit is contained in:
Leijurv 2018-09-11 18:33:03 -07:00
parent acd9cecd66
commit 9334cf1dd4
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
3 changed files with 4 additions and 3 deletions

View File

@ -152,7 +152,7 @@ public final class ChunkPacker implements Helper {
return PathingBlockType.WATER;
}
if (MovementHelper.avoidWalkingInto(block) || block.equals(Blocks.FLOWING_WATER) || MovementHelper.isBottomSlab(state)) {
if (MovementHelper.avoidWalkingInto(block) || block == Blocks.FLOWING_WATER || MovementHelper.isBottomSlab(state)) {
return PathingBlockType.AVOID;
}
// We used to do an AABB check here

View File

@ -209,7 +209,8 @@ public interface MovementHelper extends ActionCosts, Helper {
}
static boolean avoidWalkingInto(Block block) {
return BlockStateInterface.isLava(block)
return block instanceof BlockLiquid
|| block instanceof BlockDynamicLiquid
|| block == Blocks.MAGMA
|| block == Blocks.CACTUS
|| block == Blocks.FIRE

View File

@ -52,7 +52,7 @@ public class MovementParkour extends Movement {
}
BlockPos adjBlock = src.down().offset(dir);
IBlockState adj = BlockStateInterface.get(adjBlock);
if (MovementHelper.avoidWalkingInto(adj.getBlock())) { // magma sucks
if (MovementHelper.avoidWalkingInto(adj.getBlock()) && adj.getBlock() != Blocks.WATER && adj.getBlock() != Blocks.FLOWING_WATER) { // magma sucks
return null;
}
if (MovementHelper.canWalkOn(adjBlock, adj)) { // don't parkour if we could just traverse (for now)