BlastFurnaceRecipeManager

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.

script.zs
import crafttweaker.api.recipe.BlastFurnaceRecipeManager;

Description

Implements

BlastFurnaceRecipeManager implements the following interfaces:

ICookingRecipeManager<BlastingRecipe>,IRecipeManager<AbstractCookingRecipe>,CommandStringDisplayable

Undocumented Interfaces

Iterable<RecipeHolder<Recipe>>

Members

addJsonRecipe(name as string, mapData as MapData)
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.
script.zs
// BlastFurnaceRecipeManager.addJsonRecipe(name as string, mapData as MapData);
myBlastFurnaceRecipeManager.addJsonRecipe("recipe_name", {
ingredient: <item:minecraft:gold_ore>,
result: <item:minecraft:cooked_porkchop>.registryName,
experience: 0.35 as float,
cookingtime:100
});

Parameters:

name Type: string - name of the recipe
mapData Type: MapData - data representing the json file
addRecipe(name as string, output as IItemStack, input as IIngredient, xp as float, cookTime as int)
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.
script.zs
// BlastFurnaceRecipeManager.addRecipe(name as string, output as IItemStack, input as IIngredient, xp as float, cookTime as int);
myBlastFurnaceRecipeManager.addRecipe("wool2diamond", <item:minecraft:diamond>, <tag:items:minecraft:wool>, 1.0, 30);

Parameters:

name Type: string - Name of the new recipe
output Type: IItemStack - IItemStack output of the recipe
input Type: IIngredient - IIngredient input of the recipe
xp Type: float - how much xp the player gets
cookTime Type: int - how long it takes to cook
addRecipe(name as string, category as CookingBookCategory, output as IItemStack, input as IIngredient, xp as float, cookTime as int)
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.
script.zs
// BlastFurnaceRecipeManager.addRecipe(name as string, category as CookingBookCategory, output as IItemStack, input as IIngredient, xp as float, cookTime as int);
myBlastFurnaceRecipeManager.addRecipe("wool2diamond", <constant:minecraft:cookingbookcategory:misc>, <item:minecraft:diamond>, <tag:items:minecraft:wool>, 1.0, 30);

Parameters:

name Type: string - Name of the new recipe
category Type: CookingBookCategory - The category of the recipe in the recipe book
output Type: IItemStack - IItemStack output of the recipe
input Type: IIngredient - IIngredient input of the recipe
xp Type: float - how much xp the player gets
cookTime Type: int - how long it takes to cook
Getter
script.zs
// BlastFurnaceRecipeManager.allRecipes as List<RecipeHolder<Recipe>>
myBlastFurnaceRecipeManager.allRecipes

Return Type: List<RecipeHolder<Recipe>>

allRecipes() as List<RecipeHolder<Recipe>>
script.zs
// BlastFurnaceRecipeManager.allRecipes() as List<RecipeHolder<Recipe>>;
myBlastFurnaceRecipeManager.allRecipes();

Return Type: List<RecipeHolder<Recipe>>

Getter
Returns the BEP to get this thingy
script.zs
// BlastFurnaceRecipeManager.commandString as string
myBlastFurnaceRecipeManager.commandString

Return Type: string

commandString() as string
Returns the BEP to get this thingy
script.zs
// BlastFurnaceRecipeManager.commandString() as string;
myBlastFurnaceRecipeManager.commandString();

Return Type: string

getRecipeByName(name as string) as RecipeHolder<Recipe>
script.zs
// BlastFurnaceRecipeManager.getRecipeByName(name as string) as RecipeHolder<Recipe>;
myBlastFurnaceRecipeManager.getRecipeByName(myString);

Parameters:

name Type: string

Return Type: RecipeHolder<Recipe>

getRecipesByOutput(output as IIngredient) as List<RecipeHolder<Recipe>>
script.zs
// BlastFurnaceRecipeManager.getRecipesByOutput(output as IIngredient) as List<RecipeHolder<Recipe>>;
myBlastFurnaceRecipeManager.getRecipesByOutput(myIIngredient);

Parameters:

output Type: IIngredient

Return Type: List<RecipeHolder<Recipe>>

getRecipesMatching(predicate as function(t as RecipeHolder<Recipe>) as bool) as List<RecipeHolder<Recipe>>
script.zs
// BlastFurnaceRecipeManager.getRecipesMatching(predicate as function(t as RecipeHolder<Recipe>) as bool) as List<RecipeHolder<Recipe>>;
myBlastFurnaceRecipeManager.getRecipesMatching(myPredicate);

Parameters:

predicate Type: function(t as RecipeHolder<Recipe>) as bool

Return Type: List<RecipeHolder<Recipe>>

Getter
Returns a map of all known recipes.
script.zs
// BlastFurnaceRecipeManager.recipeMap as RecipeHolder<Recipe>[ResourceLocation]
myBlastFurnaceRecipeManager.recipeMap

Return Type: RecipeHolder<Recipe>[ResourceLocation]

recipeMap() as RecipeHolder<Recipe>[ResourceLocation]
Returns a map of all known recipes.

Returns: A Map of recipe name to recipe of all known recipes.

script.zs
// BlastFurnaceRecipeManager.recipeMap() as RecipeHolder<Recipe>[ResourceLocation];
myBlastFurnaceRecipeManager.recipeMap();

Return Type: RecipeHolder<Recipe>[ResourceLocation]

remove(output as IIngredient)
Remove a recipe based on it's output.
script.zs
// BlastFurnaceRecipeManager.remove(output as IIngredient);
myBlastFurnaceRecipeManager.remove(<tag:items:minecraft:wool>);

Parameters:

output Type: IIngredient - output of the recipe
removeAll()
Remove all recipes in this registry
script.zs
// BlastFurnaceRecipeManager.removeAll();
myBlastFurnaceRecipeManager.removeAll();
removeByInput(input as IItemStack)
Removes all recipes where the input contains the given IItemStack.
script.zs
// BlastFurnaceRecipeManager.removeByInput(input as IItemStack);
myBlastFurnaceRecipeManager.removeByInput(<item:minecraft:iron_ingot>);

Parameters:

input Type: IItemStack - The input IItemStack.
removeByModid(modid as string, exclude as function(t as string) as bool = (name as string) as bool => false)
Remove recipe based on Registry name modid
script.zs
// BlastFurnaceRecipeManager.removeByModid(modid as string, exclude as function(t as string) as bool = (name as string) as bool => false);
myBlastFurnaceRecipeManager.removeByModid("minecraft", myPredicate);

Parameters:

modid Type: string - modid of the recipes to remove
exclude (optional) Type: function(t as string) as bool

Default Value: (name as string) as bool => false

removeByName(names as string[])
Remove recipes based on Registry names
script.zs
// BlastFurnaceRecipeManager.removeByName(names as string[]);
myBlastFurnaceRecipeManager.removeByName(myString[]);

Parameters:

names Type: string[] - registry names of recipes to remove
removeByRegex(regex as string, exclude as function(t as string) as bool = (name as string) as bool => false)
Remove recipe based on regex with an added exclusion check, so you can remove the whole mod besides a few specified.
script.zs
// BlastFurnaceRecipeManager.removeByRegex(regex as string, exclude as function(t as string) as bool = (name as string) as bool => false);
myBlastFurnaceRecipeManager.removeByRegex("\\d_\\d", (name as string) => {return name == "orange_wool";});

Parameters:

regex Type: string - regex to match against
exclude (optional) Type: function(t as string) as bool

Default Value: (name as string) as bool => false

removeMatching(predicate as function(t as RecipeHolder<Recipe>) as bool)
Removes all recipes that match the given predicate
script.zs
// BlastFurnaceRecipeManager.removeMatching(predicate as function(t as RecipeHolder<Recipe>) as bool);
myBlastFurnaceRecipeManager.removeMatching((holder) => "wool" in holder.id.path);

Parameters:

predicate Type: function(t as RecipeHolder<Recipe>) as bool - a predicate of RecipeHolder<T> to test recipes against.
removeRecipe(output as IItemStack, input as IIngredient)
Removes a recipe based on it's output and input.
script.zs
// BlastFurnaceRecipeManager.removeRecipe(output as IItemStack, input as IIngredient);
myBlastFurnaceRecipeManager.removeRecipe(<item:minecraft:diamond>, <tag:items:minecraft:wool>);

Parameters:

output Type: IItemStack - IItemStack output of the recipe.
input Type: IIngredient - IIngredient of the recipe to remove.