CraftingTableRecipeManager
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.CraftingTableRecipeManager;
Description
Implements
CraftingTableRecipeManager
implements the following interfaces:
IRecipeManager<CraftingRecipe>
,CommandStringDisplayable
Undocumented Interfaces
Iterable<RecipeHolderRecipeHolder<Recipe>>
Members
myCraftingTableRecipeManager.addJsonRecipe("recipe_name", {ingredient: <item:minecraft:gold_ore>,result: <item:minecraft:cooked_porkchop>.registryName,experience: 0.35 as float,cookingtime:100});
// CraftingTableRecipeManager.addShaped(recipeName as string, output as IItemStack, ingredients as IIngredient[][], recipeFunction as RecipeFunction2D = null);myCraftingTableRecipeManager.addShaped(myString, myIItemStack, myIIngredient[][], myRecipeFunction2D);
Parameters:
recipeName: string
Type: string
output: IItemStack
Type: IItemStack
ingredients: IIngredient[][]
Type: IIngredient[][]
This method lets you provide a
MirrorAxis
, which can be used to set which axis the recipe is mirrored on. Use cases are making a recipe only be mirrored vertically or only horizontally.// CraftingTableRecipeManager.addShapedMirrored(recipeName as string, mirrorAxis as MirrorAxis, output as IItemStack, ingredients as IIngredient[][], recipeFunction as RecipeFunction2D = null);myCraftingTableRecipeManager.addShapedMirrored("recipe_name", MirrorAxis.DIAGONAL, <item:minecraft:dirt>, [[<item:minecraft:diamond>], [<tag:items:minecraft:wool>]], (usualOut as IItemStack, inputs as IItemStack[][]) => {if(inputs[0][0].displayName == "totally real diamond block" ){return usualOut;}return <item:minecraft:clay>.setDisplayName("Diamond");});
Parameters:
recipeName: string
Type: string
- name of the recipe to add. recipeFunction: RecipeFunction2D
(optional) Type: RecipeFunction2D
- optional RecipeFunction2D
for more advanced conditions
Default Value: null
// CraftingTableRecipeManager.addShapedPattern(recipeName as string, output as IItemStack, pattern as string[], keys as IIngredient[string], recipeFunction as RecipeFunction2D = null);myCraftingTableRecipeManager.addShapedPattern(myString, myIItemStack, myString[], myMap, myRecipeFunction2D);
Parameters:
recipeName: string
Type: string
output: IItemStack
Type: IItemStack
pattern: string[]
Type: string[]
keys: IIngredient[string]
Type: IIngredient[string]
// CraftingTableRecipeManager.addShapeless(recipeName as string, output as IItemStack, ingredients as IIngredient[], recipeFunction as RecipeFunction1D = null);myCraftingTableRecipeManager.addShapeless(myString, myIItemStack, myIIngredient[], myRecipeFunction1D);
Parameters:
recipeName: string
Type: string
output: IItemStack
Type: IItemStack
ingredients: IIngredient[]
Type: IIngredient[]
myCraftingTableRecipeManager.allRecipes
Return Type:
List<RecipeHolderRecipeHolder<Recipe>>
myCraftingTableRecipeManager.allRecipes();
Return Type:
List<RecipeHolderRecipeHolder<Recipe>>
// CraftingTableRecipeManager.commandString as stringmyCraftingTableRecipeManager.commandString
Return Type:
string
// CraftingTableRecipeManager.commandString() as string;myCraftingTableRecipeManager.commandString();
Return Type:
string
myCraftingTableRecipeManager.getRecipeByName(myString);
Parameters:
name: string
Type: string
Return Type:
RecipeHolderRecipeHolder<Recipe>
// CraftingTableRecipeManager.getRecipesByOutput(output as IIngredient) as List<RecipeHolderRecipeHolder<Recipe>>;myCraftingTableRecipeManager.getRecipesByOutput(myIIngredient);
Parameters:
output: IIngredient
Type: IIngredient
Return Type:
List<RecipeHolderRecipeHolder<Recipe>>
// CraftingTableRecipeManager.getRecipesMatching(predicate as function(t as RecipeHolderRecipeHolder<Recipe>) as bool) as List<RecipeHolderRecipeHolder<Recipe>>;myCraftingTableRecipeManager.getRecipesMatching(myPredicate);
Parameters:
predicate: function(t as RecipeHolderRecipeHolder<Recipe>) as bool
Type: function(t as RecipeHolderRecipeHolder<Recipe>) as bool
Return Type:
List<RecipeHolderRecipeHolder<Recipe>>
myCraftingTableRecipeManager.recipeMap
Return Type:
RecipeHolderRecipeHolder<Recipe>[ResourceLocation]
Returns: A Map of recipe name to recipe of all known recipes.
myCraftingTableRecipeManager.recipeMap();
Return Type:
RecipeHolderRecipeHolder<Recipe>[ResourceLocation]
myCraftingTableRecipeManager.remove(<tag:items:minecraft:wool>);
Parameters:
// CraftingTableRecipeManager.removeAll();myCraftingTableRecipeManager.removeAll();
myCraftingTableRecipeManager.removeByInput(<item:minecraft:iron_ingot>);
Parameters:
// CraftingTableRecipeManager.removeByModid(modid as string, exclude as function(t as string) as bool = (name as string) as bool => false);myCraftingTableRecipeManager.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
// CraftingTableRecipeManager.removeByName(names as string[]);myCraftingTableRecipeManager.removeByName(myString[]);
Parameters:
names: string[]
Type: string[]
- registry names of recipes to remove // CraftingTableRecipeManager.removeByRegex(regex as string, exclude as function(t as string) as bool = (name as string) as bool => false);myCraftingTableRecipeManager.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
// CraftingTableRecipeManager.removeMatching(predicate as function(t as RecipeHolderRecipeHolder<Recipe>) as bool);myCraftingTableRecipeManager.removeMatching((holder) => "wool" in holder.id.path);
Parameters:
predicate: function(t as RecipeHolderRecipeHolder<Recipe>) as bool
Type: function(t as RecipeHolderRecipeHolder<Recipe>) as bool
- a predicate of RecipeHolder<T> to test recipes against.