
[Bug] CT data `ModelProperty` provided to FramedBlocks is no longer a valid cache key
XFactHD opened this issue ยท 3 comments
Version Info
- Minecraft: 1.21.1
- NeoForge: 21.1.93
- Fusion: 1.2.2
- FramedBlocks: 10.2.1
What mod loader are you using?: NeoForge
Are you using OptiFine: No
Description of the Bug
FramedBlocks aggressivly caches generated quads and the cache key includes the CT data extracted from the ModelData
provided by the camo model if the ModelProperty
of the CT data in question is known to FramedBlocks. In the recently released refactor of Fusion, the ModelProperty
provided to FramedBlocks for CT compatibility was changed such that it is no longer compatible with the (currently unwritten, shame on me) API contract of the IMC endpoint being used:
- It no longer implements
equals()
andhashCode()
(leads to the cache in FramedBlocks being effectively bypassed and slowly leaking memory) - It contains data not suitable to be held in a cache, specifically the
BlockAndTintGetter
(significantly worsens the leak as it leads to the section data copy [or even worse the entireClientLevel
when a framed block is rendered on the main thread such as when FramedBlocks renders the placement preview with a camo applied] being kept around indefinitely) - It no longer provides data that uniquely identifies the CT state of the block being rendered (would lead to false cache hits if the first issue was fixed)
Steps to Reproduce
- Place a few framed blocks and apply a Fusion-enabled block as the camo
- Set a breakpoint in
FramedBlockModel#getQuads()
and check the size of theFramedBlockModel#quadCache
map with the debugger - Reload chunks a few times
- Repeat steps 2 and 3 a few times to observe the cache's size increasing uncontrollably