/// <summary> /// Intializes a new <see cref="SmeltRecipe"/>. Inherite from this constructor. /// </summary> /// <param name="packNamespace">The namespace the recipe is in</param> /// <param name="fileName">The name of the recipe file</param> /// <param name="writeSetting">The settings for how to write this file</param> /// <param name="group">The name of the recipe group the recipe is in. Leave null for no group.</param> /// <param name="recipeType">The type of smelting recipe</param> /// <param name="ingredients">The different types of items which can be used in the recipe</param> /// <param name="result">The result from the recipe</param> /// <param name="experience">The amount of experience to get for smelting the item</param> /// <param name="cookingTime">The amount of time it takes to cook the item</param> /// <param name="_">Unused parameter used for specifing you want to use this constructor</param> protected SmeltRecipe(bool _, BasePackNamespace packNamespace, string?fileName, SmeltType recipeType, IItemType[] ingredients, ID.Item result, double experience, NoneNegativeTime <int>?cookingTime = null, string?group = null, WriteSetting writeSetting = WriteSetting.LockedAuto) : base(packNamespace, fileName, group, writeSetting, "minecraft:" + recipeType.ToString()) { Ingredients = ingredients; Result = result; Experience = experience; CookingTime = cookingTime; }
/// <summary> /// Creates a new crafting table recipe with the given parameters /// </summary> /// <param name="name">The recipe's name</param> /// <param name="recipe">A multidimensional array describing how the items should be layed out in the crafting table</param> /// <param name="output">The output item</param> /// <param name="group">The string id of the group the recipe is in</param> /// <param name="outputCount">The amount of items to output</param> /// <param name="setting">The settings for how to write the file</param> /// <returns>The newly created recipe</returns> public CraftingRecipe Recipe(string?name, IItemType?[,] recipe, ID.Item output, int outputCount = 1, string?group = null, BaseFile.WriteSetting setting = BaseFile.WriteSetting.LockedAuto) { BaseRecipe?existingFile = null; if (!(name is null)) { existingFile = (BaseRecipe?)GetFile("recipe", name); } if (!(existingFile is null)) { throw new ArgumentException("There already exists a recipe with the name: " + existingFile.FileId + ". Use GetFile(\"recipe\",\"" + existingFile.FileId + "\") to get it."); }
/// <summary> /// Intializes a new <see cref="ShapelessRecipe"/> /// </summary> /// <param name="packNamespace">The namespace the recipe is in</param> /// <param name="fileName">The name of the recipe file</param> /// <param name="writeSetting">The settings for how to write this file</param> /// <param name="group">The name of the recipe group the recipe is in. Leave null for no group.</param> /// <param name="ingredients">The items used in the recipe</param> /// <param name="count">The amount of the result item the recipe should output</param> /// <param name="result">The item to craft</param> public ShapelessRecipe(BasePackNamespace packNamespace, string?fileName, IItemType[] ingredients, ID.Item result, int count = 1, string?group = null, WriteSetting writeSetting = WriteSetting.LockedAuto) : this(true, packNamespace, fileName, ingredients, result, count, group, writeSetting) { FinishedConstructing(); }
/// <summary> /// Intializes a new <see cref="ShapelessRecipe"/>. Inherite from this constructor. /// </summary> /// <param name="packNamespace">The namespace the recipe is in</param> /// <param name="fileName">The name of the recipe file</param> /// <param name="writeSetting">The settings for how to write this file</param> /// <param name="group">The name of the recipe group the recipe is in. Leave null for no group.</param> /// <param name="ingredients">The items used in the recipe</param> /// <param name="count">The amount of the result item the recipe should output</param> /// <param name="result">The item to craft</param> /// <param name="_">Unused parameter used for specifing you want to use this constructor</param> protected ShapelessRecipe(bool _, BasePackNamespace packNamespace, string?fileName, IItemType[] ingredients, ID.Item result, int count = 1, string?group = null, WriteSetting writeSetting = WriteSetting.LockedAuto) : base(packNamespace, fileName, group, writeSetting, "minecraft:crafting_shapeless") { Ingredients = ingredients; Result = result; Count = count; }
/// <summary> /// Intializes a new <see cref="CraftingRecipe"/> /// </summary> /// <param name="packNamespace">The namespace the recipe is in</param> /// <param name="fileName">The name of the recipe file</param> /// <param name="writeSetting">The settings for how to write this file</param> /// <param name="group">The name of the recipe group the recipe is in. Leave null for no group.</param> /// <param name="recipe">The recipe for crafting the item. Use <see cref="ID.Item.air"/> or null for empty slots</param> /// <param name="count">The amount of the result item the recipe should output</param> /// <param name="result">The item to craft</param> public CraftingRecipe(BasePackNamespace packNamespace, string?fileName, IItemType?[,] recipe, ID.Item result, int count = 1, string?group = null, WriteSetting writeSetting = WriteSetting.LockedAuto) : this(true, packNamespace, fileName, recipe, result, count, group, writeSetting) { FinishedConstructing(); }
/// <summary> /// Intializes a new <see cref="CraftingRecipe"/>. Inherite from this constructor. /// </summary> /// <param name="packNamespace">The namespace the recipe is in</param> /// <param name="fileName">The name of the recipe file</param> /// <param name="writeSetting">The settings for how to write this file</param> /// <param name="group">The name of the recipe group the recipe is in. Leave null for no group.</param> /// <param name="recipe">The recipe for crafting the item. Use <see cref="ID.Item.air"/> or null for empty slots</param> /// <param name="count">The amount of the result item the recipe should output</param> /// <param name="result">The item to craft</param> /// <param name="_">Unused parameter used for specifing you want to use this constructor</param> protected CraftingRecipe(bool _, BasePackNamespace packNamespace, string?fileName, IItemType?[,] recipe, ID.Item result, int count = 1, string?group = null, WriteSetting writeSetting = WriteSetting.LockedAuto) : base(packNamespace, fileName, group, writeSetting, "minecraft:crafting_shaped") { Recipe = recipe; Result = result; Count = count; }
/// <summary> /// Intializes a new <see cref="SmeltRecipe"/> /// </summary> /// <param name="packNamespace">The namespace the recipe is in</param> /// <param name="fileName">The name of the recipe file</param> /// <param name="writeSetting">The settings for how to write this file</param> /// <param name="group">The name of the recipe group the recipe is in. Leave null for no group.</param> /// <param name="recipeType">The type of smelting recipe</param> /// <param name="ingredient">The item to smelt</param> /// <param name="result">The result from the recipe</param> /// <param name="experience">The amount of experience to get for smelting the item</param> /// <param name="cookingTime">The amount of time in ticks it takes to cook the item</param> public SmeltRecipe(BasePackNamespace packNamespace, string?fileName, SmeltType recipeType, IItemType ingredient, ID.Item result, double experience, NoneNegativeTime <int>?cookingTime = null, string?group = null, WriteSetting writeSetting = WriteSetting.LockedAuto) : this(true, packNamespace, fileName, recipeType, new IItemType[] { ingredient }, result, experience, cookingTime, group, writeSetting) { FinishedConstructing(); }
/// <summary> /// Intializes a new <see cref="CuttingRecipe"/>. Inherite from this constructor. /// </summary> /// <param name="packNamespace">The namespace the recipe is in</param> /// <param name="fileName">The name of the recipe file</param> /// <param name="writeSetting">The settings for how to write this file</param> /// <param name="group">The name of the recipe group the recipe is in. Leave null for no group.</param> /// <param name="ingredients">The different types of items which can be used in the recipe</param> /// <param name="count">The amount of the result item the recipe should output</param> /// <param name="result">The item to craft</param> /// <param name="_">Unused parameter used for specifing you want to use this constructor</param> public CuttingRecipe(bool _, BasePackNamespace packNamespace, string?fileName, IItemType[] ingredients, ID.Item result, int count = 1, string?group = null, WriteSetting writeSetting = WriteSetting.LockedAuto) : base(packNamespace, fileName, group, writeSetting, "minecraft:stonecutting") { Ingredients = ingredients; Result = result; Count = count; }
/// <summary> /// Intializes a new <see cref="SmithingRecipe"/> /// </summary> /// <param name="packNamespace">The namespace the file should be added to</param> /// <param name="fileName">The name of the file</param> /// <param name="baseItem">The first item in the recipe (NBT will be copied from this item to the output item)</param> /// <param name="modifierItem">The second item in the recipe</param> /// <param name="output">The item the recipe outputs (Note that it will copy nbt from <see cref="BaseItem"/>)</param> /// <param name="writeSetting">The settings for how to write this file</param> public SmithingRecipe(BasePackNamespace packNamespace, string?fileName, IItemType baseItem, IItemType modifierItem, ID.Item output, WriteSetting writeSetting = WriteSetting.LockedAuto) : this(true, packNamespace, fileName, baseItem, modifierItem, output, writeSetting) { FinishedConstructing(); }
/// <summary> /// Intializes a new <see cref="SmithingRecipe"/> /// </summary> /// <param name="_">Unused parameter used for specifing you want to use this constructor</param> /// <param name="packNamespace">The namespace the file should be added to</param> /// <param name="fileName">The name of the file</param> /// <param name="baseItem">The first item in the recipe (NBT will be copied from this item to the output item)</param> /// <param name="modifierItem">The second item in the recipe</param> /// <param name="output">The item the recipe outputs (Note that it will copy nbt from <see cref="BaseItem"/>)</param> /// <param name="writeSetting">The settings for how to write this file</param> public SmithingRecipe(bool _, BasePackNamespace packNamespace, string?fileName, IItemType baseItem, IItemType modifierItem, ID.Item output, WriteSetting writeSetting = WriteSetting.LockedAuto) : base(packNamespace, fileName, null, writeSetting, "minecraft:smithing") { BaseItem = baseItem; ModifierItem = modifierItem; Output = output; }