A Recipe is a collection of ingredients, tiles, and a resulting Item. This is how players can craft items in the game.
The Basic Recipes Guideteaches how to add new recipes to the game and how to manipulate existing recipes.
Use M:Terraria.Recipe.Create(System.Int32,System.Int32) to create a Recipe instance resulting in the specified item. Use M:Terraria.Recipe.AddIngredient(System.Int32,System.Int32) to add ingredients and M:Terraria.Recipe.AddTile(System.Int32) to add crafting stations. Finally, use M:Terraria.Recipe.Register to complete the recipe and register it to the game.
Recipes can only be added in M:Terraria.ModLoader.ModSystem.AddRecipes, M:Terraria.ModLoader.ModItem.AddRecipes, and M:Terraria.ModLoader.GlobalItem.AddRecipes.
Recipes should be edited only in M:Terraria.ModLoader.ModSystem.PostAddRecipes.
More...
|
| delegate void | OnCraftCallback (Recipe recipe, Item item, List< Item > consumedItems, Item destinationStack) |
| |
| delegate void | ConsumeItemCallback (Recipe recipe, int type, ref int amount) |
| |
| void | RequireGroup (int id) |
| |
| bool | ProcessGroupsForText (int type, out string theText) |
| |
| bool | AcceptsGroup (int groupId) |
| |
| bool | AcceptedByItemGroups (int invType, int reqType) |
| |
| Recipe | AddCustomShimmerResult (int itemType, int itemStack=1) |
| |
| void | Create () |
| |
| bool | ContainsIngredient (int itemType) |
| |
| bool | HasResult (int itemID) |
| |
| bool | HasResult (Mod mod, string itemName) |
| |
| bool | HasResult (ModItem item) |
| |
| bool | HasResult< T > () |
| |
| bool | HasIngredient (int itemID) |
| |
| bool | HasIngredient (Mod mod, string itemName) |
| |
| bool | HasIngredient (ModItem item) |
| |
| bool | HasIngredient< T > () |
| |
| bool | HasRecipeGroup (int id) |
| |
| bool | HasRecipeGroup (string name) |
| |
| bool | HasRecipeGroup (RecipeGroup group) |
| |
| bool | HasTile (int tileID) |
| |
| bool | HasTile (Mod mod, string tileName) |
| |
| bool | HasTile (ModTile tile) |
| |
| bool | HasTile< T > () |
| |
| bool | HasCondition (Condition condition) |
| |
| bool | HasShimmerCondition (Condition condition) |
| |
| bool | TryGetResult (int itemID, out Item result) |
| |
| bool | TryGetResult (Mod mod, string itemName, out Item result) |
| |
| bool | TryGetResult (ModItem item, out Item result) |
| |
| bool | TryGetResult< T > (out Item result) |
| |
| bool | TryGetIngredient (int itemID, out Item ingredient) |
| |
| bool | TryGetIngredient (Mod mod, string itemName, out Item ingredient) |
| |
| bool | TryGetIngredient (ModItem item, out Item ingredient) |
| |
| bool | TryGetIngredient< T > (out Item ingredient) |
| |
| bool | RemoveIngredient (Item item) |
| |
| bool | RemoveIngredient (int itemID) |
| |
| bool | RemoveTile (int tileID) |
| |
| bool | RemoveRecipeGroup (int groupID) |
| |
| bool | RemoveCondition (Condition condition) |
| |
| bool | RemoveShimmerCondition (Condition condition) |
| |
| void | DisableRecipe () |
| |
| void | ReplaceResult (int itemID, int stack=1) |
| |
| void | ReplaceResult (Mod mod, string itemName, int stack=1) |
| |
| void | ReplaceResult (ModItem item, int stack=1) |
| |
| void | ReplaceResult< T > (int stack=1) |
| |
| Recipe | AddIngredient (int itemID, int stack=1) |
| | Adds an ingredient to this recipe with the given item type and stack size. Ex: recipe.AddIngredient(ItemID.IronAxe)
|
| |
| Recipe | AddIngredient (Mod mod, string itemName, int stack=1) |
| | Adds an ingredient to this recipe with the given item name from the given mod, and with the given stack stack. If the mod parameter is null, then it will automatically use an item from the mod creating this recipe.
|
| |
| Recipe | AddIngredient (ModItem item, int stack=1) |
| | Adds an ingredient to this recipe of the given type of item and stack size.
|
| |
| Recipe | AddIngredient< T > (int stack=1) |
| | Adds an ingredient to this recipe of the given type of item and stack size.
|
| |
| Recipe | AddRecipeGroup (string name, int stack=1) |
| | Adds a recipe group ingredient to this recipe with the given RecipeGroup name and stack size.
Recipe groups allow a recipe to use alternate ingredients without making multiple recipes. For example the "IronBar" group accepts either F:Terraria.ID.ItemID.IronBar or F:Terraria.ID.ItemID.LeadBar. The Recipe Groups wiki guidehas more information.
To use a vanilla recipe group, use M:Terraria.Recipe.AddRecipeGroup(System.Int32,System.Int32) using a T:Terraria.ID.RecipeGroupID entry instead.
|
| |
| Recipe | AddRecipeGroup (int recipeGroupId, int stack=1) |
| | Adds a recipe group ingredient to this recipe with the given RecipeGroupID and stack size.
Recipe groups allow a recipe to use alternate ingredients without making multiple recipes. For example the F:Terraria.ID.RecipeGroupID.IronBar group accepts either F:Terraria.ID.ItemID.IronBar or F:Terraria.ID.ItemID.LeadBar. The Recipe Groups wiki guidehas more information.
Vanilla recipe group IDs can be found in T:Terraria.ID.RecipeGroupID and modded recipe group IDs will be returned from M:Terraria.RecipeGroup.RegisterGroup(System.String,Terraria.RecipeGroup). M:Terraria.Recipe.AddRecipeGroup(System.String,System.Int32) can be used instead if the ID number is not known but the name is known.
|
| |
| Recipe | AddRecipeGroup (RecipeGroup recipeGroup, int stack=1) |
| | Adds a recipe group ingredient to this recipe with the given RecipeGroup.
|
| |
| Recipe | AddTile (int tileID) |
| | Adds a required crafting station with the given tile type to this recipe. Ex: recipe.AddTile(TileID.WorkBenches)
|
| |
| Recipe | AddTile (Mod mod, string tileName) |
| | Adds a required crafting station to this recipe with the given tile name from the given mod. If the mod parameter is null, then it will automatically use a tile from the mod creating this recipe.
|
| |
| Recipe | AddTile (ModTile tile) |
| | Adds a required crafting station to this recipe of the given type of tile.
|
| |
| Recipe | AddTile< T > () |
| | Adds a required crafting station to this recipe of the given type of tile.
|
| |
| Recipe | AddCondition (LocalizedText description, Func< bool > condition) |
| | Sets a condition delegate that will determine whether or not the recipe will be to be available for the player to use. The condition can be unrelated to items or tiles (for example, biome or time).
|
| |
| Recipe | AddCondition (params Condition[] conditions) |
| | Adds an array of conditions that will determine whether or not the recipe will be to be available for the player to use. The conditions can be unrelated to items or tiles (for example, biome or time).
|
| |
| Recipe | AddCondition (Condition condition) |
| |
| Recipe | AddCondition (IEnumerable< Condition > conditions) |
| | Adds a collection of conditions that will determine whether or not the recipe will be to be available for the player to use. The conditions can be unrelated to items or tiles (for example, biome or time).
|
| |
| Recipe | AddDecraftCondition (LocalizedText description, Func< bool > condition) |
| | Sets a condition delegate that will determine whether or not the recipe can be shimmered/decrafted. The condition can be unrelated to items or tiles (for example, biome or time).
|
| |
| Recipe | AddDecraftCondition (params Condition[] conditions) |
| | Adds an array of conditions that will determine whether or not the recipe can be shimmered/decrafted. The conditions can be unrelated to items or tiles (for example, biome or time).
|
| |
| Recipe | AddDecraftCondition (Condition condition) |
| |
| Recipe | AddDecraftCondition (IEnumerable< Condition > conditions) |
| | Adds a collection of conditions that will determine whether or not the recipe can be shimmered/decrafted. The conditions can be unrelated to items or tiles (for example, biome or time).
|
| |
| Recipe | ApplyConditionsAsDecraftConditions () |
| | Adds every condition from Recipe.Conditions to Recipe.DecraftConditions, checking for duplicates.
|
| |
| Recipe | DisableDecraft () |
| | Sets a check that is used during load to prevent this being shimmered/decrafted.
|
| |
| Recipe | AddOnCraftCallback (OnCraftCallback callback) |
| | Sets a callback that will allow you to make anything happen when the recipe is used to create an item.
|
| |
| Recipe | AddConsumeItemCallback (ConsumeItemCallback callback) |
| | Sets a callback that allows you to determine how many of a certain ingredient is consumed when this recipe is used. Return the number of ingredients that will actually be consumed. By default returns numRequired.
|
| |
| Recipe | SortBeforeFirstRecipesOf (int itemId) |
| | Sorts the recipe before the first one creating the item of the ID given as parameter.
|
| |
| Recipe | SortBefore (Recipe recipe) |
| | Sorts the recipe before the one given as parameter. Both recipes must already be registered.
|
| |
| Recipe | SortAfterFirstRecipesOf (int itemId) |
| | Sorts the recipe after the first one creating the item of the ID given as parameter.
|
| |
| Recipe | SortAfter (Recipe recipe) |
| | Sorts the recipe after the one given as parameter. Both recipes must already be registered.
|
| |
| Recipe | Clone () |
| | Returns a clone of this recipe except the source mod of the Recipe will the currently loading mod.
The clone will have to be registered after being tweaked.
|
| |
| Recipe | Register () |
| | Adds this recipe to the game. Call this after you have finished setting the result, ingredients, etc.
|
| |
A Recipe is a collection of ingredients, tiles, and a resulting Item. This is how players can craft items in the game.
The Basic Recipes Guide
teaches how to add new recipes to the game and how to manipulate existing recipes.
Use M:Terraria.Recipe.Create(System.Int32,System.Int32) to create a Recipe instance resulting in the specified item. Use M:Terraria.Recipe.AddIngredient(System.Int32,System.Int32) to add ingredients and M:Terraria.Recipe.AddTile(System.Int32) to add crafting stations. Finally, use M:Terraria.Recipe.Register to complete the recipe and register it to the game.
Recipes can only be added in M:Terraria.ModLoader.ModSystem.AddRecipes, M:Terraria.ModLoader.ModItem.AddRecipes, and M:Terraria.ModLoader.GlobalItem.AddRecipes.
Recipes should be edited only in M:Terraria.ModLoader.ModSystem.PostAddRecipes.
Definition at line 21 of file Recipe.cs.