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
Comparable<Enum>
,Iterable<Recipe>
Enum Constants
CraftingTableRecipeManager is an enum with 1 constant. It is accessible like so:
CraftingTableRecipeManager.INSTANCE
Members
craftingTable.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);craftingTable.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);craftingTable.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);craftingTable.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);craftingTable.addShapeless(myString, myIItemStack, myIIngredient[], myRecipeFunction1D);
Parameters:
recipeName: string
Type: string
output: IItemStack
Type: IItemStack
ingredients: IIngredient[]
Type: IIngredient[]
// CraftingTableRecipeManager.commandString as stringcraftingTable.commandString
Return Type:
string
// CraftingTableRecipeManager.commandString() as string;craftingTable.commandString();
Return Type:
string
craftingTable.getRecipesByOutput(myIIngredient);
Parameters:
output: IIngredient
Type: IIngredient
Return Type:
List<Recipe>
craftingTable.recipeMap
Return Type:
Recipe[ResourceLocation]
Returns: A Map of recipe name to recipe of all known recipes.
craftingTable.recipeMap();
Return Type:
Recipe[ResourceLocation]
craftingTable.remove(<tag:items:minecraft:wool>);
Parameters:
// CraftingTableRecipeManager.removeAll();craftingTable.removeAll();
craftingTable.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);craftingTable.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[]);craftingTable.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);craftingTable.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