MineColonies

MineColonies

57M Downloads

AbstractPathJob does not respect block shape

baileyholl opened this issue ยท 3 comments

commented

When checking for passability of a particular block, a check is made for if the material blocks motion, but is missing a check on the ability for the actual blockstate to collide, or its shape. This causes entities to attempt to jump over or on top of blocks that they could easily walk over.

The primary line is here:

The final else condition where the voxel shape is checked is never made for blocks who have a material that blocks motion such as stone but are actually pathable.

The fix for my case was making an additional check on that line to ensure that both the material blocks motion AND the blockstate itself blocks motion by using another voxel shape check.

Going from:

if (block.getMaterial().blocksMotion())

to

if (block.getMaterial().blocksMotion() && !(shape.isEmpty() || shape.max(Direction.Axis.Y) <= 0.1))
commented

If you've fixed it, you're welcome to open a PR!

commented

I asked them to open it.

commented

Whoops, didn't actually mean to close it at all, just leave a comment