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 . ICookingRecipeManager;
Default interface for Registry based handlers as they can all remove recipes by ResourceLocation. ICookingRecipeManager <AbstractCookingRecipe >
implements the following interfaces:
IRecipeManager <AbstractCookingRecipe >
,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. // ICookingRecipeManager<T : AbstractCookingRecipe>.addJsonRecipe(name as string, mapData as MapData);
myICookingRecipeManager . 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
Adds a recipe based on given params. Note: A cookTime
of 0
will cause the recipe to never complete, it will burn and use fuel, but no progress will be made on the recipe, it needs to be at-least 1
or more. Saying that, if you would like to make a recipe that will never complete (for example being able to give the player an infinitely burning furnace for whatever reason), you can still use a cookTime
of 0
. // ICookingRecipeManager<T : AbstractCookingRecipe>.addRecipe(name as string, output as IItemStack, input as IIngredient, xp as float, cookTime as int);
myICookingRecipeManager . addRecipe( "wool2diamond" , < item : minecraft:diamond > , < tag : items:minecraft:wool > , 1.0 , 30 );
Parameters:
name: string
Type: string
- Name of the new recipe
xp: float
Type: float
- how much xp the player gets
cookTime: int
Type: int
- how long it takes to cook
Adds a recipe based on given params. Note: A cookTime
of 0
will cause the recipe to never complete, it will burn and use fuel, but no progress will be made on the recipe, it needs to be at-least 1
or more. Saying that, if you would like to make a recipe that will never complete (for example being able to give the player an infinitely burning furnace for whatever reason), you can still use a cookTime
of 0
. // ICookingRecipeManager<T : AbstractCookingRecipe>.addRecipe(name as string, category as CookingBookCategory, output as IItemStack, input as IIngredient, xp as float, cookTime as int);
myICookingRecipeManager . addRecipe( "wool2diamond" , < constant : minecraft:cookingbookcategory:misc > , < item : minecraft:diamond > , < tag : items:minecraft:wool > , 1.0 , 30 );
Parameters:
name: string
Type: string
- Name of the new recipe
xp: float
Type: float
- how much xp the player gets
cookTime: int
Type: int
- how long it takes to cook
// ICookingRecipeManager<T : AbstractCookingRecipe>.allRecipes as List<RecipeHolder<Recipe>>
myICookingRecipeManager . allRecipes
Return Type:
List <RecipeHolderRecipeHolder <Recipe > >
// ICookingRecipeManager<T : AbstractCookingRecipe>.allRecipes() as List<RecipeHolder<Recipe>>;
myICookingRecipeManager . allRecipes();
Return Type:
List <RecipeHolderRecipeHolder <Recipe > >
Returns the BEP to get this thingy // ICookingRecipeManager<T : AbstractCookingRecipe>.commandString as string
myICookingRecipeManager . commandString
Return Type:
string
Returns the BEP to get this thingy // ICookingRecipeManager<T : AbstractCookingRecipe>.commandString() as string;
myICookingRecipeManager . commandString();
Return Type:
string
// ICookingRecipeManager<T : AbstractCookingRecipe>.getRecipeByName(name as string) as RecipeHolder<Recipe>;
myICookingRecipeManager . getRecipeByName(myString);
Parameters:
name: string
Type: string
Return Type:
RecipeHolderRecipeHolder <Recipe >
// ICookingRecipeManager<T : AbstractCookingRecipe>.getRecipesByOutput(output as IIngredient) as List<RecipeHolder<Recipe>>;
myICookingRecipeManager . getRecipesByOutput(myIIngredient);
Return Type:
List <RecipeHolderRecipeHolder <Recipe > >
// ICookingRecipeManager<T : AbstractCookingRecipe>.getRecipesMatching(predicate as function(t as RecipeHolder<Recipe>) as bool) as List<RecipeHolder<Recipe>>;
myICookingRecipeManager . getRecipesMatching(myPredicate);
Return Type:
List <RecipeHolderRecipeHolder <Recipe > >
Returns a map of all known recipes. // ICookingRecipeManager<T : AbstractCookingRecipe>.recipeMap as RecipeHolder<Recipe>[ResourceLocation]
myICookingRecipeManager . recipeMap
Return Type:
RecipeHolderRecipeHolder <Recipe > [ResourceLocation ]
Returns a map of all known recipes. Returns : A Map of recipe name to recipe of all known recipes.
// ICookingRecipeManager<T : AbstractCookingRecipe>.recipeMap() as RecipeHolder<Recipe>[ResourceLocation];
myICookingRecipeManager . recipeMap();
Return Type:
RecipeHolderRecipeHolder <Recipe > [ResourceLocation ]
Remove a recipe based on it's output. // ICookingRecipeManager<T : AbstractCookingRecipe>.remove(output as IIngredient);
myICookingRecipeManager . remove( < tag : items:minecraft:wool > );
Remove all recipes in this registry // ICookingRecipeManager<T : AbstractCookingRecipe>.removeAll();
myICookingRecipeManager . removeAll();
Removes all recipes where the input contains the given IItemStack. // ICookingRecipeManager<T : AbstractCookingRecipe>.removeByInput(input as IItemStack);
myICookingRecipeManager . removeByInput( < item : minecraft:iron_ingot > );
Remove recipe based on Registry name modid // ICookingRecipeManager<T : AbstractCookingRecipe>.removeByModid(modid as string, exclude as function(t as string) as bool = (name as string) as bool => false);
myICookingRecipeManager . 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 // ICookingRecipeManager<T : AbstractCookingRecipe>.removeByName(names as string[]);
myICookingRecipeManager . 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. // ICookingRecipeManager<T : AbstractCookingRecipe>.removeByRegex(regex as string, exclude as function(t as string) as bool = (name as string) as bool => false);
myICookingRecipeManager . 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 // ICookingRecipeManager<T : AbstractCookingRecipe>.removeMatching(predicate as function(t as RecipeHolder<Recipe>) as bool);
myICookingRecipeManager . removeMatching((holder) => "wool" in holder . id . path);
Removes a recipe based on it's output and input. // ICookingRecipeManager<T : AbstractCookingRecipe>.removeRecipe(output as IItemStack, input as IIngredient);
myICookingRecipeManager . removeRecipe( < item : minecraft:diamond > , < tag : items:minecraft:wool > );