1.16-1.18 LazyOptional.invalidate gets not called on TileEntities when removed
Speiger opened this issue ยท 4 comments
Since 1.14 Capabilities are Cacheable due to forge adding a listener function that allows you get notified when capabilities unload.
If you cache a Capability and do not get notified that the capability got invalidated it just keeps the reference and doesn't see the new capability provider.
We just have a RF Producer that started voiding energy when we broke your battery and replaced it.
Required methods to simplify the fixing:
- TileEntity.invalidateCaps is called from all the places where it needs to be
- LazyOptional.invalidate invalidates the caches as needed.
Could you fix this please
Those should be properly called since cap invalidation was added. Where exactly do you think it's not being called?
You may have forgotten to implement that then, as looking through your code clearly shows that.