SmithingRecipeManager
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.SmithingRecipeManager;
Description
Implements
SmithingRecipeManager
implements the following interfaces:
IRecipeManager<SmithingRecipe>
,CommandStringDisplayable
Undocumented Interfaces
Iterable<RecipeHolder<Recipe>>
Members
mySmithingRecipeManager.addJsonRecipe("recipe_name", {ingredient: <item:minecraft:gold_ore>,result: <item:minecraft:cooked_porkchop>.registryName,experience: 0.35 as float,cookingtime:100});
// SmithingRecipeManager.addTransformRecipe(recipeName as string, result as IItemStack, template as IIngredient, base as IIngredient, addition as IIngredient);mySmithingRecipeManager.addTransformRecipe("recipe_name", <item:minecraft:golden_apple>, myIIngredient, <item:minecraft:apple>, <tag:items:forge:ingots/gold>);
Parameters:
recipeName: string
Type: string
- Name of the recipe. // SmithingRecipeManager.addTrimRecipe(recipeName as string, template as IIngredient, base as IIngredient, addition as IIngredient);mySmithingRecipeManager.addTrimRecipe("recipe_name", myIIngredient, <item:minecraft:apple>, <tag:items:forge:ingots/gold>);
Parameters:
recipeName: string
Type: string
- Name of the recipe. mySmithingRecipeManager.allRecipes
Return Type:
List<RecipeHolder<Recipe>>
// SmithingRecipeManager.commandString as stringmySmithingRecipeManager.commandString
Return Type:
string
// SmithingRecipeManager.commandString() as string;mySmithingRecipeManager.commandString();
Return Type:
string
mySmithingRecipeManager.getRecipeByName(myString);
Parameters:
name: string
Type: string
Return Type:
RecipeHolder<Recipe>
mySmithingRecipeManager.getRecipesByOutput(myIIngredient);
Parameters:
output: IIngredient
Type: IIngredient
Return Type:
List<RecipeHolder<Recipe>>
// SmithingRecipeManager.getRecipesMatching(predicate as function(t as RecipeHolder<Recipe>) as bool) as List<RecipeHolder<Recipe>>;mySmithingRecipeManager.getRecipesMatching(myPredicate);
Parameters:
predicate: function(t as RecipeHolder<Recipe>) as bool
Type: function(t as RecipeHolder<Recipe>) as bool
Return Type:
List<RecipeHolder<Recipe>>
mySmithingRecipeManager.recipeMap
Return Type:
RecipeHolder<Recipe>[ResourceLocation]
Returns: A Map of recipe name to recipe of all known recipes.
mySmithingRecipeManager.recipeMap();
Return Type:
RecipeHolder<Recipe>[ResourceLocation]
mySmithingRecipeManager.remove(<tag:items:minecraft:wool>);
Parameters:
// SmithingRecipeManager.removeAll();mySmithingRecipeManager.removeAll();
mySmithingRecipeManager.removeByInput(<item:minecraft:iron_ingot>);
Parameters:
// SmithingRecipeManager.removeByModid(modid as string, exclude as function(t as string) as bool = (name as string) as bool => false);mySmithingRecipeManager.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
// SmithingRecipeManager.removeByName(names as string[]);mySmithingRecipeManager.removeByName(myString[]);
Parameters:
names: string[]
Type: string[]
- registry names of recipes to remove // SmithingRecipeManager.removeByRegex(regex as string, exclude as function(t as string) as bool = (name as string) as bool => false);mySmithingRecipeManager.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
mySmithingRecipeManager.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.