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

◆ SetOrdering()

Recipe Terraria.Recipe.SetOrdering ( Recipe recipe,
bool after )
inlineprivate

Sets the Ordering of this recipe. This recipe can't already have one.

Definition at line 16465 of file Recipe.cs.

16466 {
16468 {
16469 throw new RecipeException("You can only move recipes during setup");
16470 }
16471 if (Main.recipe[recipe.RecipeIndex] != recipe)
16472 {
16473 throw new RecipeException("The selected recipe is not registered.");
16474 }
16475 if (Ordering.target != null)
16476 {
16477 throw new RecipeException("This recipe already has an ordering.");
16478 }
16479 Ordering = (target: recipe, after: after);
16480 Recipe target = recipe;
16481 do
16482 {
16483 if (target == this)
16484 {
16485 throw new Exception("Recipe ordering loop!");
16486 }
16488 }
16489 while (target != null);
16490 return this;
16491 }
static bool setupRecipes
Set when tML sets up modded recipes. Used to detect misuse of CreateRecipe.
This is where all Recipe hooks are gathered and called.
Recipe bool after Ordering
Definition Recipe.cs:123
Recipe target
Definition Recipe.cs:123
static Recipe()
Definition Recipe.cs:130

References Terraria.Recipe.Ordering, Terraria.Main.recipe, Terraria.Recipe.RecipeIndex, Terraria.ModLoader.RecipeLoader.setupRecipes, and Terraria.Recipe.target.

Referenced by Terraria.Recipe.SortAfter(), and Terraria.Recipe.SortBefore().

+ Here is the caller graph for this function: