TheTrueBrawler
Plantera
Another problem I am running into is that now I want to make an item with multiple recipes possible. I am attempting to make an accessory that can be crafted in many different ways. I used TModReader to extract code from another mod to try and get a good frame of reference, but it was for an outdated version of TModLoader. When I try to do the same thing, I get the error pasted below the code.
How does one go about getting multiple crafting recipes on one accessory? I have multiple items in my mod I need to know how to do this for.
How does one go about getting multiple crafting recipes on one accessory? I have multiple items in my mod I need to know how to do this for.
Code:
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.BundleofBalloons);
recipe.AddIngredient(ItemID.LuckyHorseshoe);
recipe.AddTile(TileID.TinkerersWorkbench);
recipe.SetResult(this);
recipe.AddRecipe();
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.BlueHorseshoeBalloon);
recipe.AddIngredient(ItemID.BlizzardinaBalloon);
recipe.AddIngredient(ItemID.SandstorminaBalloon);
recipe.AddTile(TileID.TinkerersWorkbench);
recipe.SetResult(this);
recipe.AddRecipe();
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.CloudinaBalloon);
recipe.AddIngredient(ItemID.WhiteHorseshoeBalloon);
recipe.AddIngredient(ItemID.SandstorminaBalloon);
recipe.AddTile(TileID.TinkerersWorkbench);
recipe.SetResult(this);
recipe.AddRecipe();
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.CloudinaBalloon);
recipe.AddIngredient(ItemID.BlizzardinaBalloon);
recipe.AddIngredient(ItemID.YellowHorseshoeBalloon);
recipe.AddTile(TileID.TinkerersWorkbench);
recipe.SetResult(this);
recipe.AddRecipe();
}
Code:
...TheTrueBrawler\Items\Accessories\BundleOfHorseshoeBalloons.cs(42,23) : error CS0128: A local variable named 'recipe' is already defined in this scope