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;
Default interface for Registry based handlers as they can all remove recipes by ResourceLocation. IRecipeManager <Recipe >
implements the following interfaces:
CommandStringDisplayable
Undocumented Interfaces Iterable <RecipeHolderRecipeHolder <Recipe > >
Adds a recipe based on a provided IData. The provided IData should represent a DataPack json, this effectively allows you to register recipes for any DataPack supporting RecipeType systems. // IRecipeManager<T : Recipe>.addJsonRecipe(name as string, mapData as MapData);
myIRecipeManager . addJsonRecipe( "recipe_name" , {
ingredient: < item : minecraft:gold_ore > ,
result: < item : minecraft:cooked_porkchop > .registryName,
experience: 0.35 as float ,
Parameters:
name: string
Type: string
- name of the recipe
// IRecipeManager<T : Recipe>.allRecipes() as List<RecipeHolder<Recipe>>;
myIRecipeManager . allRecipes();
Return Type:
List <RecipeHolderRecipeHolder <Recipe > >
// IRecipeManager<T : Recipe>.getRecipeByName(name as string) as RecipeHolder<Recipe>;
myIRecipeManager . getRecipeByName(myString);
Parameters:
name: string
Type: string
Return Type:
RecipeHolderRecipeHolder <Recipe >
// IRecipeManager<T : Recipe>.getRecipesByOutput(output as IIngredient) as List<RecipeHolder<Recipe>>;
myIRecipeManager . getRecipesByOutput(myIIngredient);
Return Type:
List <RecipeHolderRecipeHolder <Recipe > >
// IRecipeManager<T : Recipe>.getRecipesMatching(predicate as function(t as RecipeHolder<Recipe>) as bool) as List<RecipeHolder<Recipe>>;
myIRecipeManager . getRecipesMatching(myPredicate);
Return Type:
List <RecipeHolderRecipeHolder <Recipe > >
Returns a map of all known recipes. Returns : A Map of recipe name to recipe of all known recipes.
// IRecipeManager<T : Recipe>.recipeMap() as RecipeHolder<Recipe>[ResourceLocation];
myIRecipeManager . recipeMap();
Return Type:
RecipeHolderRecipeHolder <Recipe > [ResourceLocation ]
Remove a recipe based on it's output. // IRecipeManager<T : Recipe>.remove(output as IIngredient);
myIRecipeManager . remove( < tag : items:minecraft:wool > );
Remove all recipes in this registry // IRecipeManager<T : Recipe>.removeAll();
myIRecipeManager . removeAll();
Removes all recipes where the input contains the given IItemStack. // IRecipeManager<T : Recipe>.removeByInput(input as IItemStack);
myIRecipeManager . removeByInput( < item : minecraft:iron_ingot > );
Remove recipe based on Registry name modid // 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
Remove recipes based on Registry names // IRecipeManager<T : Recipe>.removeByName(names as string[]);
myIRecipeManager . removeByName(myString[]);
Parameters:
names: string []
Type: string []
- registry names of recipes to remove
Remove recipe based on regex with an added exclusion check, so you can remove the whole mod besides a few specified. // 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
Removes all recipes that match the given predicate // IRecipeManager<T : Recipe>.removeMatching(predicate as function(t as RecipeHolder<Recipe>) as bool);
myIRecipeManager . removeMatching((holder) => "wool" in holder . id . path);