[Void/Dupe Bug] Capabilities are not supporting 1.16+ features
Speiger opened this issue ยท 3 comments
o/ It's me again
Forge introduced with 1.14 I think Capability caching in Tile/BlockEntitites.
It is one of the major optimizations they started including.
Sadly Sophisticated Storage doesn't support this feature.
How to fix it:
Cache the LazyOptional and invalidate it when the capability should no longer be accessed.
invalidateCaps function in BlockEntity.class is the function you should use to invalidate it.
It is called with chunk unloading and block breaking.
This can lead to item voiding/duplicating, because the mods that trust to receive notifications if the inventory was invalidated can still access the "ghost" blocks inventory and effectively create new items out of thin air.
Thank you for reading.
Thanks for letting me know about this. I had no idea that it's cool for other mods to cache the LazyOptional and there's a way to handle invalidation of those now.
I have added this in both storage and backpack for next release