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

◆ AddRecipes()

static void Terraria.ModLoader.RecipeLoader.AddRecipes ( )
inlinestaticpackage

Definition at line 39 of file RecipeLoader.cs.

40 {
41 MethodInfo addRecipesMethod = typeof(Mod).GetMethod("AddRecipes", BindingFlags.Instance | BindingFlags.Public);
42 Mod[] mods = ModLoader.Mods;
43 for (int i = 0; i < mods.Length; i++)
44 {
45 Mod mod = (CurrentMod = mods[i]);
46 try
47 {
48 addRecipesMethod.Invoke(mod, Array.Empty<object>());
49 SystemLoader.AddRecipes(mod);
50 LoaderUtils.ForEachAndAggregateExceptions(mod.GetContent<ModItem>(), delegate(ModItem item)
51 {
52 item.AddRecipes();
53 });
54 LoaderUtils.ForEachAndAggregateExceptions(mod.GetContent<GlobalItem>(), delegate(GlobalItem global)
55 {
56 global.AddRecipes();
57 });
58 }
59 catch (Exception ex)
60 {
61 ex.Data["mod"] = mod.Name;
62 throw;
63 }
64 finally
65 {
66 CurrentMod = null;
67 }
68 }
69 }
static Mod CurrentMod
The mod currently adding recipes.

References Terraria.ModLoader.ModItem.AddRecipes(), Terraria.ModLoader.SystemLoader.AddRecipes(), Terraria.ModLoader.RecipeLoader.CurrentMod, Terraria.ModLoader.Mod.GetContent(), Terraria.ModLoader.ModLoader.Mods, and Terraria.ModLoader.Mod.Name.

Referenced by Terraria.Recipe.SetupRecipes().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: