YouTubeModding14 icon indicating copy to clipboard operation
YouTubeModding14 copied to clipboard

You should invalidate the LazyOptionals in TileEntities

Open LukeGi opened this issue 4 years ago • 1 comments

In your tile entity classes with LazyOptional<?> fields, you should be overriding the invalidate method in the tile, and calling lazyOptional.invalidate(); on them.

LukeGi avatar Jun 25 '20 13:06 LukeGi

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.

LukeGi avatar Jun 25 '20 13:06 LukeGi