multi Level Cache#5117
Conversation
|
So testing these changes with a debugger: 1ste slot iron -> Recipe manager look up Looking at these last 2 interactions, for the 2d slot, the slot cache can be used. However it does not set the inventory cache when used, making it so a look up is used later. Should this be changed so using the slot cache also updates the inventory cache? Or am I missing a case? The advantage of this setup is that if instead of the last iron, gold was used in slot 4, the inventory cache would resolve it. |
|
I am not sure the slot cache should override the inventory cache on a cache hit, if they differ, odds are the next item in the smeltery will also be different. Probably best to stick with what we have, as that is simplier. The important thing is that when finding a new recipe, it is cached at both the slot and inventory level. Additionally, when a slot has a cache miss, it should cache the inventory recipe even if that was a cache hit. Both of these appear to be done already |
Adds a second level cache to the melting inventory.
The constructor of a melting module now takes the parent inventory instead of the block entity. If the Block entity is needed, it can be gotten from the inventory.