ICookingRecipeManager
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.ICookingRecipeManager;
Description
Default interface for Registry based handlers as they can all remove recipes by ResourceLocation.Implements
ICookingRecipeManager<AbstractCookingRecipe>
implements the following interfaces:
IRecipeManager<AbstractCookingRecipe>
,CommandStringDisplayable
Undocumented Interfaces
Iterable<RecipeHolder<Recipe>>
Members
// ICookingRecipeManager<T : AbstractCookingRecipe>.addJsonRecipe(name as string, mapData as MapData);furnace.addJsonRecipe("recipe_name", {ingredient: <item:minecraft:gold_ore>,result: <item:minecraft:cooked_porkchop>.registryName,experience: 0.35 as float,cookingtime:100});
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);furnace.addRecipe("wool2diamond", <item:minecraft:diamond>, <tag:item: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 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);furnace.addRecipe("wool2diamond", <constant:minecraft:cookingbookcategory:misc>, <item:minecraft:diamond>, <tag:item:minecraft:wool>, 1.0, 30);
Parameters:
name: string
Type: string
- Name of the new recipe category: CookingBookCategory
Type: CookingBookCategory
- The category of the recipe in the recipe book xp: float
Type: float
- how much xp the player gets cookTime: int
Type: int
- how long it takes to cook furnace.allRecipes
Return Type:
List<RecipeHolder<Recipe>>
furnace.commandString
Return Type:
string
furnace.commandString();
Return Type:
string
// ICookingRecipeManager<T : AbstractCookingRecipe>.getRecipeByName(name as string) as RecipeHolder<Recipe>;furnace.getRecipeByName(myString);
Parameters:
name: string
Type: string
Return Type:
RecipeHolder<Recipe>
// ICookingRecipeManager<T : AbstractCookingRecipe>.getRecipesByOutput(output as IIngredient) as List<RecipeHolder<Recipe>>;furnace.getRecipesByOutput(myIIngredient);
Parameters:
output: IIngredient
Type: IIngredient
Return Type:
List<RecipeHolder<Recipe>>
// ICookingRecipeManager<T : AbstractCookingRecipe>.getRecipesMatching(predicate as function(t as RecipeHolder<Recipe>) as bool) as List<RecipeHolder<Recipe>>;furnace.getRecipesMatching(myPredicate);
Parameters:
predicate: function(t as RecipeHolder<Recipe>) as bool
Type: function(t as RecipeHolder<Recipe>) as bool
Return Type:
List<RecipeHolder<Recipe>>
// ICookingRecipeManager<T : AbstractCookingRecipe>.recipeMap as RecipeHolder<Recipe>[ResourceLocation]furnace.recipeMap
Return Type:
RecipeHolder<Recipe>[ResourceLocation]
Returns: A Map of recipe name to recipe of all known recipes.
// ICookingRecipeManager<T : AbstractCookingRecipe>.recipeMap() as RecipeHolder<Recipe>[ResourceLocation];furnace.recipeMap();
Return Type:
RecipeHolder<Recipe>[ResourceLocation]
furnace.remove(<tag:item:minecraft:wool>);
Parameters:
furnace.removeAll();
furnace.removeByInput(<item:minecraft:iron_ingot>);
Parameters:
// ICookingRecipeManager<T : AbstractCookingRecipe>.removeByModid(modid as string, exclude as function(t as string) as bool = (name as string) as bool => false);furnace.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
furnace.removeByName(myString[]);
Parameters:
names: string[]
Type: string[]
- registry names of recipes to remove // ICookingRecipeManager<T : AbstractCookingRecipe>.removeByRegex(regex as string, exclude as function(t as string) as bool = (name as string) as bool => false);furnace.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
// ICookingRecipeManager<T : AbstractCookingRecipe>.removeMatching(predicate as function(t as RecipeHolder<Recipe>) as bool);furnace.removeMatching((holder) => "wool" in holder.id.path);
Parameters:
predicate: function(t as RecipeHolder<Recipe>) as bool
Type: function(t as RecipeHolder<Recipe>) as bool
- a predicate of RecipeHolder<T> to test recipes against. // ICookingRecipeManager<T : AbstractCookingRecipe>.removeRecipe(output as IItemStack, input as IIngredient);furnace.removeRecipe(<item:minecraft:diamond>, <tag:item:minecraft:wool>);
Parameters: