IRecipeManager
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.recipe.IRecipeManager;
Description
Default interface for Registry based handlers as they can all remove recipes by ResourceLocation.Implements
IRecipeManager<Recipe>
implements the following interfaces:
Undocumented Interfaces
Iterable<RecipeHolderRecipeHolder<Recipe>>
Members
myIRecipeManager.addJsonRecipe("recipe_name", {ingredient: <item:minecraft:gold_ore>,result: <item:minecraft:cooked_porkchop>.registryName,experience: 0.35 as float,cookingtime:100});
myIRecipeManager.allRecipes
Return Type:
List<RecipeHolderRecipeHolder<Recipe>>
myIRecipeManager.getRecipeByName(myString);
Parameters:
name: string
Type: string
Return Type:
RecipeHolderRecipeHolder<Recipe>
// IRecipeManager<T : Recipe>.getRecipesByOutput(output as IIngredient) as List<RecipeHolderRecipeHolder<Recipe>>;myIRecipeManager.getRecipesByOutput(myIIngredient);
Parameters:
output: IIngredient
Type: IIngredient
Return Type:
List<RecipeHolderRecipeHolder<Recipe>>
// IRecipeManager<T : Recipe>.getRecipesMatching(predicate as function(t as RecipeHolderRecipeHolder<Recipe>) as bool) as List<RecipeHolderRecipeHolder<Recipe>>;myIRecipeManager.getRecipesMatching(myPredicate);
Parameters:
predicate: function(t as RecipeHolderRecipeHolder<Recipe>) as bool
Type: function(t as RecipeHolderRecipeHolder<Recipe>) as bool
Return Type:
List<RecipeHolderRecipeHolder<Recipe>>
myIRecipeManager.recipeMap
Return Type:
RecipeHolderRecipeHolder<Recipe>[ResourceLocation]
Returns: A Map of recipe name to recipe of all known recipes.
myIRecipeManager.recipeMap();
Return Type:
RecipeHolderRecipeHolder<Recipe>[ResourceLocation]
myIRecipeManager.remove(<tag:items:minecraft:wool>);
Parameters:
myIRecipeManager.removeAll();
myIRecipeManager.removeByInput(<item:minecraft:iron_ingot>);
Parameters:
// IRecipeManager<T : Recipe>.removeByModid(modid as string, exclude as function(t as string) as bool = (name as string) as bool => false);myIRecipeManager.removeByModid("minecraft", myPredicate);
Parameters:
modid: string
Type: string
- modid of the recipes to remove exclude: function(t as string) as bool
(optional) Type: function(t as string) as bool
Default Value: (name as string) as bool => false
myIRecipeManager.removeByName(myString[]);
Parameters:
names: string[]
Type: string[]
- registry names of recipes to remove // IRecipeManager<T : Recipe>.removeByRegex(regex as string, exclude as function(t as string) as bool = (name as string) as bool => false);myIRecipeManager.removeByRegex("\\d_\\d", (name as string) => {return name == "orange_wool";});
Parameters:
regex: string
Type: string
- regex to match against exclude: function(t as string) as bool
(optional) Type: function(t as string) as bool
Default Value: (name as string) as bool => false
// IRecipeManager<T : Recipe>.removeMatching(predicate as function(t as RecipeHolderRecipeHolder<Recipe>) as bool);myIRecipeManager.removeMatching((holder) => "wool" in holder.id.path);
Parameters:
predicate: function(t as RecipeHolderRecipeHolder<Recipe>) as bool
Type: function(t as RecipeHolderRecipeHolder<Recipe>) as bool
- a predicate of RecipeHolder<T> to test recipes against.