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;
SmithingRecipeManager
implements the following interfaces:
IRecipeManager <SmithingRecipe >
,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. // SmithingRecipeManager.addJsonRecipe(name as string, mapData as MapData);
mySmithingRecipeManager . 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 new transform recipe to the smithing table. // 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.
Adds a new trim recipe to the smithing table. // 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.
// SmithingRecipeManager.allRecipes as List<RecipeHolder<Recipe>>
mySmithingRecipeManager . allRecipes
Return Type:
List <RecipeHolderRecipeHolder <Recipe > >
// SmithingRecipeManager.allRecipes() as List<RecipeHolder<Recipe>>;
mySmithingRecipeManager . allRecipes();
Return Type:
List <RecipeHolderRecipeHolder <Recipe > >
Returns the BEP to get this thingy // SmithingRecipeManager.commandString as string
mySmithingRecipeManager . commandString
Return Type:
string
Returns the BEP to get this thingy // SmithingRecipeManager.commandString() as string;
mySmithingRecipeManager . commandString();
Return Type:
string
// SmithingRecipeManager.getRecipeByName(name as string) as RecipeHolder<Recipe>;
mySmithingRecipeManager . getRecipeByName(myString);
Parameters:
name: string
Type: string
Return Type:
RecipeHolderRecipeHolder <Recipe >
// SmithingRecipeManager.getRecipesByOutput(output as IIngredient) as List<RecipeHolder<Recipe>>;
mySmithingRecipeManager . getRecipesByOutput(myIIngredient);
Return Type:
List <RecipeHolderRecipeHolder <Recipe > >
// SmithingRecipeManager.getRecipesMatching(predicate as function(t as RecipeHolder<Recipe>) as bool) as List<RecipeHolder<Recipe>>;
mySmithingRecipeManager . 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.
// SmithingRecipeManager.recipeMap() as RecipeHolder<Recipe>[ResourceLocation];
mySmithingRecipeManager . recipeMap();
Return Type:
RecipeHolderRecipeHolder <Recipe > [ResourceLocation ]
Remove a recipe based on it's output. // SmithingRecipeManager.remove(output as IIngredient);
mySmithingRecipeManager . remove( < tag : items:minecraft:wool > );
Remove all recipes in this registry // SmithingRecipeManager.removeAll();
mySmithingRecipeManager . removeAll();
Removes all recipes where the input contains the given IItemStack. // SmithingRecipeManager.removeByInput(input as IItemStack);
mySmithingRecipeManager . removeByInput( < item : minecraft:iron_ingot > );
Remove recipe based on Registry name modid // 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
Remove recipes based on Registry names // SmithingRecipeManager.removeByName(names as string[]);
mySmithingRecipeManager . 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. // 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
Removes all recipes that match the given predicate // SmithingRecipeManager.removeMatching(predicate as function(t as RecipeHolder<Recipe>) as bool);
mySmithingRecipeManager . removeMatching((holder) => "wool" in holder . id . path);