How do I make my modded recipe use any gold bar?

Tondy

Terrarian
Hi, I have been trying to make my modded sword use any gold bar, but I can't seem to do it right. I have tried 2 methods, one was making a recipe group, but it doesn't work:

using Terraria;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;

namespace MeleeExpanded.Recipes
{
public class Recipes : ModSystem
{
public static RecipeGroup AnyGoldBar;

public override void Unload()
{
AnyGoldBar = null;
}

public override void AddRecipeGroups()
{
RecipeGroup AnyGoldBar = new RecipeGroup(() => $"{Language.GetTextValue("LegacyMisc.37")} {Lang.GetItemNameValue(ItemID.GoldBar)}", ItemID.GoldBar, ItemID.PlatinumBar);
RecipeGroup.RegisterGroup("Any Gold bar", AnyGoldBar);
}

public override void AddRecipes()
{
Recipe recipe5 = Recipe.Create(mod,"ShinyDagger");
recipe5.AddRecipeGroup("Any Gold Bar", 12);
recipe5.AddIngredient(ItemID.Star, 3);
recipe5.AddTile(TileID.Anvils);
recipe5.Register();
}
}
}

Then, I tried to use the anyGoldBar = true; But it didn't work:

public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.FallenStar, 3);
recipe.AddIngredient(ItemID.GoldBar, 12);
recipe.anyGoldBar = true;
recipe.AddTile(TileID.Anvils);
recipe.SetResult(this);
recipe.AddRecipe();
}
If anyone could help, I would greatly appriciate it :) .
 
Back
Top Bottom