tModLoader v2023.01
A mod to make and play Terraria mods
Terraria.ModLoader.RecipeLoader Class Reference

This is where all Recipe and GlobalRecipe hooks are gathered and called. More...

Static Public Member Functions

static void ConsumeItem (Recipe recipe, int type, ref int amount)
 Allows to edit the amount of item the player uses in a recipe. More...
 
static void OnCraft (Item item, Recipe recipe, Item destinationStack)
 Helper version of OnCraft, used in combination with Recipe.Create and the internal ConsumedItems list More...
 
static void OnCraft (Item item, Recipe recipe, List< Item > consumedItems, Item destinationStack)
 recipe.OnCraftHooks followed by Calls ItemLoader.OnCreate with a RecipeCreationContext More...
 
static bool RecipeAvailable (Recipe recipe)
 Returns whether or not the conditions are met for this recipe to be available for the player to use. More...
 

Detailed Description

This is where all Recipe and GlobalRecipe hooks are gathered and called.

Member Function Documentation

◆ ConsumeItem()

static void Terraria.ModLoader.RecipeLoader.ConsumeItem ( Recipe  recipe,
int  type,
ref int  amount 
)
static

Allows to edit the amount of item the player uses in a recipe.

Parameters
recipeThe recipe used for the craft.
typeType of the ingredient.
amountModifiable amount of the item consumed.

◆ OnCraft() [1/2]

static void Terraria.ModLoader.RecipeLoader.OnCraft ( Item  item,
Recipe  recipe,
Item  destinationStack 
)
static

Helper version of OnCraft, used in combination with Recipe.Create and the internal ConsumedItems list

Parameters
item
recipe
destinationStackThe stack that the crafted item will be combined with

◆ OnCraft() [2/2]

static void Terraria.ModLoader.RecipeLoader.OnCraft ( Item  item,
Recipe  recipe,
List< Item consumedItems,
Item  destinationStack 
)
static

recipe.OnCraftHooks followed by Calls ItemLoader.OnCreate with a RecipeCreationContext

Parameters
itemThe item crafted.
recipeThe recipe used to craft the item.
consumedItemsMaterials used to craft the item.
destinationStackThe stack that the crafted item will be combined with

◆ RecipeAvailable()

static bool Terraria.ModLoader.RecipeLoader.RecipeAvailable ( Recipe  recipe)
static

Returns whether or not the conditions are met for this recipe to be available for the player to use.

Parameters
recipeThe recipe to check.
Returns
Whether or not the conditions are met for this recipe.