/// <summary> /// Adds a recipe group ingredient to this recipe with the given RecipeGroupID and stack size. Vanilla recipe group IDs can be found in Terraria.ID.RecipeGroupID and modded recipe group IDs will be returned from RecipeGroup.RegisterGroup. /// </summary> /// <param name="recipeGroupId">The RecipeGroupID.</param> /// <param name="stack">The stack.</param> /// <exception cref="RecipeException">A recipe group with the ID " + recipeGroupID + " does not exist.</exception> public Recipe AddRecipeGroup(int recipeGroupId, int stack = 1) { if (!RecipeGroup.recipeGroups.ContainsKey(recipeGroupId)) { throw new RecipeException($"A recipe group with the ID {recipeGroupId} does not exist."); } RecipeGroup rec = RecipeGroup.recipeGroups[recipeGroupId]; AddIngredient(rec.IconicItemId, stack); AddGroup(recipeGroupId); return(this); }
public override void AddRecipeGroups() { Terraria.RecipeGroup HardmodeEvilMaterial = new Terraria.RecipeGroup(() => "Any hardmode evil material", new int[] { ItemID.CursedFlame, ItemID.Ichor }); Terraria.RecipeGroup.RegisterGroup("Spectra:HardmodeEvil", HardmodeEvilMaterial); Terraria.RecipeGroup EvilPick = new Terraria.RecipeGroup(() => "Any evil pickaxe", new int[] { ItemID.NightmarePickaxe, ItemID.DeathbringerPickaxe }); Terraria.RecipeGroup.RegisterGroup("Spectra:EvilPick", EvilPick); }
public bool HasRecipeGroup(RecipeGroup group) => HasRecipeGroup(group.ID);