Pipez

Pipez

31M Downloads

Capabilities are not invalidated

rlnt opened this issue · 1 comments

commented

Bug description
Accessing the capabilities of your pipes and attaching a listener to it will result in the listener never being executed.
You never invalidate your capabilities which requires other mods to use strange workarounds if they cache their caps.

Steps to reproduce the issue

  1. Access the energy capability of a pipe.
  2. Cache it and attach a listener which invalidates the cache.
  3. Remove the pipe
  4. See that the cache never invalidates.

Expected behavior
Upon removal of the pipe or changing the configuration of the pipe, the energy capabilities should be invalidated so listeners are correctly called.

Code
The caching method I use for my mod is explained here: https://forge.gemwire.uk/wiki/Capabilities/1.16#Accessing_a_Capability
capability.addListener() usually fires when you invalidate the capability in your mod with cap.invalidate() and this would clear my cache.
However, because you never do that, the listener is never fired.

Versions

  • Minecraft version: 1.16.5
  • Forge version: 36.2.4
  • Mod version: 1.2.7

Other mods
Lollipop 3.2.9
Powah 2.3.16

commented

Thank you for reporting this to me!