Occultism

Occultism

19M Downloads

Pathfinding issue (and solution)

desht opened this issue ยท 1 comments

commented

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:

  1. Place down a Storage Actuator, or a "fence" of actuators
  2. Put a vanilla mob behind that "fence", e.g. a cow.
  3. Tempt the cow with some wheat
  4. 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.

Screenshots
image

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 :)

commented

That is an absolutely lovely bug report (those with solutions are the best ;) ), thanks a lot!
There's indeed a handful of blocks that need to be updated accordingly.