TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ TryGetIngredient() [2/3]

bool Terraria.Recipe.TryGetIngredient ( Mod mod,
string itemName,
out Item ingredient )
inline

Definition at line 16090 of file Recipe.cs.

16091 {
16092 if (mod == null)
16093 {
16094 mod = Mod;
16095 }
16096 if (!ModContent.TryFind<ModItem>(mod.Name, itemName, out var item))
16097 {
16098 throw new RecipeException($"The item {itemName} does not exist in the mod {mod.Name}.\r\nIf you are trying to use a vanilla item, try removing the first argument.");
16099 }
16100 return TryGetIngredient(item.Type, out ingredient);
16101 }
Manages content added by mods. Liasons between mod content and Terraria's arrays and oversees the Loa...
Definition ModContent.cs:38
This class serves as a place for you to place all your properties and hooks for each item....
Definition ModItem.cs:24
virtual string Name
Stores the name of the mod. This name serves as the mod's identification, and also helps with saving ...
Definition Mod.cs:66
readonly Mod Mod
Definition Recipe.cs:108
bool TryGetIngredient(int itemID, out Item ingredient)
Definition Recipe.cs:16076

References Terraria.Recipe.Mod, Terraria.ModLoader.Mod.Name, and Terraria.Recipe.TryGetIngredient().

+ Here is the call graph for this function: