Capabilities are not invalidated
rlnt opened this issue · 1 comments
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
- Access the energy capability of a pipe.
- Cache it and attach a listener which invalidates the cache.
- Remove the pipe
- 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