lucaargolo / crafting-bench

Yet another advanced Craftfting Table mod. My entry for ModFest: Singularity
Mozilla Public License 2.0
2 stars 0 forks source link

[1.19.2] Recipe lookup on interact taking a long time #1

Open PapiOphidian opened 1 year ago

PapiOphidian commented 1 year ago

The modpack I've made does include quite a few mods which adds a lot of recipes and the time taken to build a list of craftable recipes is very considerable. The time wasted is also very noticeable considering the fact that this happens every time you interact with the bench versus what can be crafted being cached.

What I would suggest is to not just take a standard approach and caching when at least one of the inventories the bench searches through changes, but rather on recipes loading (startup, runtime through stuff like kubejs or the likes), building a tree of everything and using an algorithm like alpha-beta pruning to filter the list whenever an inventory the bench searches through does eventually change and cache that result.

If that suggestion isn't viable, then I'd at least let the user know that the bench is looking through the recipes somehow and possibly as the bench finds recipes, populate the list of craftables versus waiting for the entire filter to finish.

leafreynolds commented 9 months ago

+1 to this issue. If the recipe finder takes too long, it just silently dies.