2using System.Collections.Generic;
11 internal static readonly IList<GlobalRecipe> globalRecipes =
new List<GlobalRecipe>();
16 internal static bool setupRecipes =
false;
19 globalRecipes.Add(globalRecipe);
22 internal static void Unload() {
23 globalRecipes.Clear();
27 internal static void AddRecipes() {
31 foreach (
ModItem item
in mod.items.Values)
33 foreach (
GlobalItem globalItem
in mod.globalItems.Values)
37 e.Data[
"mod"] = mod.
Name;
43 internal static void PostAddRecipes() {
49 e.Data[
"mod"] = mod.
Name;
78 public static void OnCraft(Item item, Recipe recipe) {
80 if (modRecipe !=
null) {
84 globalRecipe.
OnCraft(item, recipe);
This class allows you to modify and use hooks for all items, including vanilla items....
virtual void AddRecipes()
This is essentially the same as Mod.AddRecipes or ModItem.AddRecipes. Use whichever method makes orga...
This class provides hooks that control all recipes in the game.
virtual bool RecipeAvailable(Recipe recipe)
Whether or not the conditions are met for the given recipe to be available for the player to use....
virtual void OnCraft(Item item, Recipe recipe)
Allows you to make anything happen when the player uses the given recipe. The item parameter is the i...
Mod is an abstract class that you will override. It serves as a central place from which the mod's co...
virtual string Name
Stores the name of the mod. This name serves as the mod's identification, and also helps with saving ...
virtual void PostAddRecipes()
This provides a hook into the mod-loading process immediately after recipes have been added....
virtual void AddRecipes()
Override this method to add recipes to the game. It is recommended that you do so through instances o...
This class serves as a place for you to place all your properties and hooks for each item....
virtual void AddRecipes()
This is essentially the same as Mod.AddRecipes. Do note that this will be called for every instance o...
This serves as the central class which loads mods. It contains many static fields and methods related...
This class extends Terraria.Recipe, meaning you can use it in a similar manner to vanilla recipes....
virtual bool RecipeAvailable()
Whether or not the conditions are met for this recipe to be available for the player to use....
virtual void OnCraft(Item item)
Allows you to make anything happen when the player uses this recipe. The item parameter is the item ...
This is where all ModRecipe and GlobalRecipe hooks are gathered and called.
static void OnCraft(Item item, Recipe recipe)
Allows you to make anything happen when a player uses this recipe.
static bool RecipeAvailable(Recipe recipe)
Returns whether or not the conditions are met for this recipe to be available for the player to use.