GenericRecipesManager
Importing the class
If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.
import crafttweaker.api.GenericRecipesManager;Description
This recipe manager allows you to perform removal actions over all recipe managers. You can access this manager by using therecipes global keyword. Members
Unlike the addJSONRecipe method in IRecipeManager you **must** set the type of the recipe within the JSON yourself.
myGenericRecipesManager.addJsonRecipe("recipe_name", {type: "minecraft:smoking",ingredient: <item:minecraft:gold_ore>,result: <item:minecraft:cooked_porkchop>,experience: 0.35 as float,cookingtime: 100});myGenericRecipesManager.allManagers
Return Type:
List<IRecipeManager<?>>
myGenericRecipesManager.allManagers();
Return Type:
List<IRecipeManager<?>>
myGenericRecipesManager.allRecipes
Return Type:
List<RecipeHolder<Recipe<Container>>>
myGenericRecipesManager.getRecipeByName(myString);Parameters:
name: string Type: string
Return Type:
RecipeHolder<Recipe<Container>>
// GenericRecipesManager.getRecipesByOutput(output as IIngredient) as List<RecipeHolder<Recipe<Container>>>;myGenericRecipesManager.getRecipesByOutput(myIIngredient);Parameters:
output: IIngredient Type: IIngredient
Return Type:
List<RecipeHolder<Recipe<Container>>>
// GenericRecipesManager.getRecipesMatching(predicate as function(t as RecipeHolder<Recipe<Container>>) as bool) as List<RecipeHolder<Recipe<Container>>>;myGenericRecipesManager.getRecipesMatching(myPredicate);Parameters:
predicate: function(t as RecipeHolder<Recipe<Container>>) as bool Type: function(t as RecipeHolder<Recipe<Container>>) as bool
Return Type:
List<RecipeHolder<Recipe<Container>>>
myGenericRecipesManager.recipeMap
Return Type:
RecipeHolder<Recipe<Container>>[ResourceLocation]
Returns: A Map of recipe name to recipe of all known recipes.
myGenericRecipesManager.recipeMap();
Return Type:
RecipeHolder<Recipe<Container>>[ResourceLocation]
myGenericRecipesManager.remove(<item:minecraft:iron_ingot>);Parameters:
// GenericRecipesManager.removeAll();myGenericRecipesManager.removeAll();myGenericRecipesManager.removeByInput(<item:minecraft:iron_ingot>);Parameters:
// GenericRecipesManager.removeByModid(modId as string);myGenericRecipesManager.removeByModid("crafttweaker");Parameters:
modId: string Type: string
- The mod's modId // GenericRecipesManager.removeByModid(modId as string, exclude as function(t as string) as bool);myGenericRecipesManager.removeByModid("minecraft", (recipeName as string) => recipeName == "white_bed");Parameters:
modId: string Type: string
- The mod's modid exclude: function(t as string) as bool Type: function(t as string) as bool
- Function that returns true if the recipe should remain in the registry. // GenericRecipesManager.removeByName(names as string[]);myGenericRecipesManager.removeByName(myString[]);Parameters:
names: string[] Type: string[]
- registry names of recipes to remove // GenericRecipesManager.removeByRegex(regex as string);myGenericRecipesManager.removeByRegex("\\d_\\d");Parameters:
regex: string Type: string
- regex to match against // GenericRecipesManager.removeMatching(predicate as function(t as RecipeHolder<Recipe<Container>>) as bool);myGenericRecipesManager.removeMatching((holder) => "wool" in holder.id.path);Parameters:
predicate: function(t as RecipeHolder<Recipe<Container>>) as bool Type: function(t as RecipeHolder<Recipe<Container>>) as bool
- a predicate of RecipeHolder<Recipe<Container>> to test recipes against.