/// <summary> /// <para>Allows you to add or edit RecipeData for TechTypes.</para> /// <para>Can be used for existing TechTypes too.</para> /// </summary> /// <param name="techType">The TechType whose TechData you want to edit.</param> /// <param name="recipeData">The TechData for that TechType.</param> /// <seealso cref="RecipeData"/> void ICraftDataHandler.SetTechData(TechType techType, RecipeData recipeData) { var currentTechType = new JsonValue { { TechData.PropertyToID("techType"), new JsonValue((int)techType) }, { TechData.PropertyToID("craftAmount"), new JsonValue(recipeData.craftAmount) } }; CraftDataPatcher.CustomTechData[techType] = currentTechType; if (recipeData.ingredientCount > 0) { Main.AddIngredients(techType, recipeData.Ingredients); } if (recipeData.linkedItemCount > 0) { Main.AddLinkedItems(techType, recipeData.LinkedItems); } }
/// <summary> /// <para>Allows you to add linked items for a TechType crafting recipe.</para> /// <para>Can be used for existing TechTypes too.</para> /// </summary> /// <param name="techType">The TechType whose ingredient list you want to edit.</param> /// <param name="linkedItems">The collection of linked items for that TechType</param> public static void AddLinkedItems(TechType techType, ICollection <TechType> linkedItems) { Main.AddLinkedItems(techType, linkedItems); }