Machines check all recipes when trying to insert #2522
Technici4n
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Machines check all recipes when they check if an item is valid for an input slot. For example, see this profile from a public AOF server:

(The pipe stuff is actually a similar issue where the puller is checking if an item is a valid furnace fuel, and I'm already working on a fix: FabricMC/fabric#1108)
I think this can be solved by building a cache
Map<Item, List<Recipes>>that lists every recipe that uses a given item. That way, you only need to match on the cached recipes that are already using one of the items. That should improve performance for all machines. I did something similar with my mod, see https://github.com/AztechMC/Modern-Industrialization/blob/1ae80da2d1f6df7d32d284d7e3c391b855947695/src/main/java/aztech/modern_industrialization/machines/recipe/MachineRecipeType.java#L42.Beta Was this translation helpful? Give feedback.
All reactions