stop walking into liquids, fixes #155
This commit is contained in:
parent
acd9cecd66
commit
9334cf1dd4
@ -152,7 +152,7 @@ public final class ChunkPacker implements Helper {
|
|||||||
return PathingBlockType.WATER;
|
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;
|
return PathingBlockType.AVOID;
|
||||||
}
|
}
|
||||||
// We used to do an AABB check here
|
// We used to do an AABB check here
|
||||||
|
@ -209,7 +209,8 @@ public interface MovementHelper extends ActionCosts, Helper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static boolean avoidWalkingInto(Block block) {
|
static boolean avoidWalkingInto(Block block) {
|
||||||
return BlockStateInterface.isLava(block)
|
return block instanceof BlockLiquid
|
||||||
|
|| block instanceof BlockDynamicLiquid
|
||||||
|| block == Blocks.MAGMA
|
|| block == Blocks.MAGMA
|
||||||
|| block == Blocks.CACTUS
|
|| block == Blocks.CACTUS
|
||||||
|| block == Blocks.FIRE
|
|| block == Blocks.FIRE
|
||||||
|
@ -52,7 +52,7 @@ public class MovementParkour extends Movement {
|
|||||||
}
|
}
|
||||||
BlockPos adjBlock = src.down().offset(dir);
|
BlockPos adjBlock = src.down().offset(dir);
|
||||||
IBlockState adj = BlockStateInterface.get(adjBlock);
|
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;
|
return null;
|
||||||
}
|
}
|
||||||
if (MovementHelper.canWalkOn(adjBlock, adj)) { // don't parkour if we could just traverse (for now)
|
if (MovementHelper.canWalkOn(adjBlock, adj)) { // don't parkour if we could just traverse (for now)
|
||||||
|
Loading…
Reference in New Issue
Block a user