RS Cables pathfinding problem (and solution)
desht opened this issue ยท 1 comments
Issue description:
Refined Storage cable blocks (and possibly other blocks in RS?) don't override Block#allowsMovement()
. Specifically, this method is intended to determine whether or not an entity can pathfind through the block; the default for land-based and flying entities is to allow pathfinding if the block doesn't have an opaque collision shape. Unfortunately, because RS cable blocks have a movement-blocking collision box, entities will get stuck (forever) when trying to pathfind through them.
What happens:
Entities will attempt to pathfind through RS cables even though they can't move through them.
What you expected to happen:
Entities should know to path around or over these blocks.
Steps to reproduce:
See screenshot below
- Create a 3x3 ring "fence" of cables
- Put a cow in the middle of it
- Hold some wheat. Cow should step/hop over the cable to get to you, but instead tries to path through the cable and gets stuck.
This is easy to fix: simply override allowsMovement()
to return false
in those blocks of yours which are not a full cube, but do have a movement-blocking collision shape. You will notice that vanilla does this for many of its blocks.
Version (make sure you are on the latest version before reporting):
- Minecraft: 1.16.4
- Forge: 36.0.44
- Refined Storage: 1.9.12
Does this issue occur on a server? [yes/no] yes
If a (crash)log is relevant for this issue, link it here:
n/a
Note: the reason I'm reporting this is PneumaticCraft drones easily get stuck on RS cables. And you're far from the only mod author to miss overriding allowsMovement()
- it's an easy one to miss and the effects are subtle with most entities, but PNC drones love to find these problems :)