YouTubeModding14
YouTubeModding14 copied to clipboard
You should invalidate the LazyOptionals in TileEntities
In your tile entity classes with LazyOptional<?>
fields, you should be overriding the invalidate method in the tile, and calling lazyOptional.invalidate();
on them.
By doing this you ensure that any other blocks that store a reference to the LazyOptional instance release their cached value resulting in no references to it, which will allow for proper garbage collection.