Skip to content

Commit

Permalink
make them work in the water as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Raycoms committed Sep 9, 2018
1 parent 92f1043 commit 48ef14a
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ private boolean isEntityAtSiteWithMove(@NotNull final BlockPos site, final int r
proxy = new GeneralEntityWalkToProxy(entity);
}

if (new AxisAlignedBB(entity.getPosition()).expand(1, 2, 1)
if (new AxisAlignedBB(entity.getPosition()).expand(1, 1, 1).expand(-1, -1, -1)
.intersects(new AxisAlignedBB(lastPos)))
{
stuckTime++;
Expand Down Expand Up @@ -182,11 +182,11 @@ private boolean isEntityAtSiteWithMove(@NotNull final BlockPos site, final int r
final IBlockState ladderUp = world.getBlockState(entity.getPosition().up());
if (entity.getLadderCounter() <= LADDERS_TO_PLACE || random.nextBoolean())
{
if (ladderHere.getBlock() == Blocks.LADDER && ladderUp.getBlock() != Blocks.LADDER)
if (ladderHere.getBlock() == Blocks.LADDER && ladderUp.getBlock() != Blocks.LADDER && !ladderHere.getMaterial().isLiquid())
{
world.setBlockState(entity.getPosition().up(), ladderHere);
}
else if(ladderUp.getBlock() == Blocks.LADDER && ladderHere.getBlock() != Blocks.LADDER)
else if(ladderUp.getBlock() == Blocks.LADDER && ladderHere.getBlock() != Blocks.LADDER && !ladderUp.getMaterial().isLiquid())
{
world.setBlockState(entity.getPosition(), ladderUp);
}
Expand All @@ -200,7 +200,7 @@ else if (ladderUp.getBlock() != Blocks.LADDER && ladderHere.getBlock() != Blocks
{
world.setBlockState(entity.getPosition().up(), Blocks.LADDER.getDefaultState().withProperty(BlockLadder.FACING, dir.getOpposite()));
}
else
else if (!ladderHere.getMaterial().isLiquid())
{
world.setBlockState(entity.getPosition(), Blocks.LADDER.getDefaultState().withProperty(BlockLadder.FACING, dir.getOpposite()));
}
Expand Down

0 comments on commit 48ef14a

Please sign in to comment.