CraftTweaker

CraftTweaker

151M Downloads

[Feature Request] Recipe uses for IIngredient

Charnuz opened this issue ยท 3 comments

commented

Feature request description
A way to get all the recipes that use a given ingredient as an input.

Feature request reason
Currently, there is no easy way to get the recipe uses for an item other than going through each recipe (which with a script, makes a significant hit to load speed.)

I am attempting to do a recursive function that takes an input and applies operations to the input, and every item the input can be used to craft, and so on.

Feature request dependencies
Will require a method similar to recipes.getRecipesFor

commented

Probably won't be implemented since too inefficient and it would face the same problems the current IRecipe getters also have:

Some recipes aren't registered until much later and while we can stage the actions of the recipe removals we cannot stage the script execution to ensure all recipes that you may want to iterate over are present.

commented

Maybe in the future if a re-write comes along, having the ability to set what stage a script loads in would be beneficial.

commented

As kindlich said, people add recipes after we run scripts, so we can't reliably provide a way to iterate over recipes.