Terraria ModLoader  0.10.1.5
A framework for Terraria mods
Terraria.ModLoader.GlobalRecipe Class Reference

This class provides hooks that control all recipes in the game. More...

Public Member Functions

virtual bool Autoload (ref string name)
 Allows you to automatically load a GlobalRecipe instead of using Mod.AddGlobalRecipe. Return true to allow autoloading; by default returns the mod's autoload property. Name is initialized to the overriding class name. Use this method to either force or stop an autoload, and to change the default internal name. More...
 
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 item the player has just crafted. More...
 
virtual bool RecipeAvailable (Recipe recipe)
 Whether or not the conditions are met for the given recipe to be available for the player to use. This hook can be used for conditions unrelated to items or tiles (for example, biome or time). More...
 

Properties

Mod mod [get, set]
 The mod which added this GlobalRecipe. More...
 
string Name [get, set]
 The name of this GlobaRecipe. More...
 

Detailed Description

This class provides hooks that control all recipes in the game.

Definition at line 6 of file GlobalRecipe.cs.

Member Function Documentation

virtual bool Terraria.ModLoader.GlobalRecipe.Autoload ( ref string  name)
virtual

Allows you to automatically load a GlobalRecipe instead of using Mod.AddGlobalRecipe. Return true to allow autoloading; by default returns the mod's autoload property. Name is initialized to the overriding class name. Use this method to either force or stop an autoload, and to change the default internal name.

Definition at line 27 of file GlobalRecipe.cs.

Referenced by Terraria.ModLoader.Mod.AutoloadGlobalRecipe().

27  {
28  return mod.Properties.Autoload;
29  }
ModProperties Properties
Definition: Mod.cs:49
bool Autoload
Whether or not this mod will autoload content by default. Autoloading content means you do not need t...
Mod mod
The mod which added this GlobalRecipe.
Definition: GlobalRecipe.cs:11

+ Here is the caller graph for this function:

virtual void Terraria.ModLoader.GlobalRecipe.OnCraft ( Item  item,
Recipe  recipe 
)
virtual

Allows you to make anything happen when the player uses the given recipe. The item parameter is the item the player has just crafted.

Parameters
itemThe item created.
recipeThe recipe used to create the item.

Definition at line 43 of file GlobalRecipe.cs.

Referenced by Terraria.ModLoader.RecipeHooks.OnCraft().

43  {
44  }

+ Here is the caller graph for this function:

virtual bool Terraria.ModLoader.GlobalRecipe.RecipeAvailable ( Recipe  recipe)
virtual

Whether or not the conditions are met for the given recipe to be available for the player to use. This hook can be used for conditions unrelated to items or tiles (for example, biome or time).

Definition at line 34 of file GlobalRecipe.cs.

Referenced by Terraria.ModLoader.RecipeHooks.RecipeAvailable().

34  {
35  return true;
36  }

+ Here is the caller graph for this function:

Property Documentation

Mod Terraria.ModLoader.GlobalRecipe.mod
getset

The mod which added this GlobalRecipe.

Definition at line 11 of file GlobalRecipe.cs.

Referenced by Terraria.ModLoader.Mod.AddGlobalRecipe(), and Terraria.ModLoader.Mod.AutoloadGlobalRecipe().

string Terraria.ModLoader.GlobalRecipe.Name
getset

The name of this GlobaRecipe.

Definition at line 19 of file GlobalRecipe.cs.

Referenced by Terraria.ModLoader.Mod.AddGlobalRecipe().