Pathfinding issue (and solution)
desht opened this issue ยท 1 comments
Describe the bug
Hi, I'm the author of PneumaticCraft: Repressurized, and I just had a report from a player about PNC drones getting stuck on a Storage Actuator. I believe that's https://github.com/klikli-dev/occultism/blob/main/src/main/java/com/github/klikli_dev/occultism/common/block/storage/StorageControllerBlock.java but correct me if I'm wrong.
The problem is that the block doesn't override the isPathfindable()
method (allowsMovement()
in MCP mappings) to return false, which any block with a non-full shape but a movement-blocking collision box needs to do. See BlockHopper
for a vanilla example.
I only checked for the Storage Actuator, but I imagine other blocks of yours may also need checking for this.
To Reproduce
Steps to reproduce the behavior:
- Place down a Storage Actuator, or a "fence" of actuators
- Put a vanilla mob behind that "fence", e.g. a cow.
- Tempt the cow with some wheat
- The cow will try (and fail) to walk through your blocks, instead of around or over them.
Expected behavior
Entities need to not try and pathfind through your blocks.
System (please complete the following information):
n/a, not system-specific
Additional context
This is a common problem in mods, since it's subtle and hard to spot. But PneumaticCraft drones are exceptionally good at finding such blocks and getting stuck in them :)