1.1.0 - Added a config option to use tMx or Vanilla Materials

This commit is contained in:
mikx 2025-02-16 18:07:05 -05:00
parent ff68fc53f5
commit 89b4deb0f0
3 changed files with 51 additions and 18 deletions

View File

@ -15,25 +15,36 @@ namespace tTP.Content.Items.Placeable
public override void AddRecipes() public override void AddRecipes()
{ {
Recipe recipe = CreateRecipe(); tTPConfigs config = ModContent.GetInstance<tTPConfigs>();
if (ModLoader.TryGetMod("tMx", out Mod tMxft) && tMxft.TryFind<ModItem>("FrozenTablet", out ModItem FrozenTablet)) if (config.UsetMxTablets)
{ {
recipe.AddIngredient(FrozenTablet.Type, 1); Recipe recipe = CreateRecipe();
} if (ModLoader.TryGetMod("tMx", out Mod tMxft) && tMxft.TryFind<ModItem>("FrozenTablet", out ModItem FrozenTablet))
if (ModLoader.TryGetMod("tMx", out Mod tMxst) && tMxst.TryFind<ModItem>("SandTablet", out ModItem SandTablet)) {
recipe.AddIngredient(FrozenTablet.Type, 1);
}
if (ModLoader.TryGetMod("tMx", out Mod tMxst) && tMxst.TryFind<ModItem>("SandTablet", out ModItem SandTablet))
{
recipe.AddIngredient(SandTablet.Type, 1);
}
if (ModLoader.TryGetMod("tMx", out Mod tMxtt) && tMxtt.TryFind<ModItem>("ToxicTablet", out ModItem ToxicTablet))
{
recipe.AddIngredient(ToxicTablet.Type, 1);
}
if (ModLoader.TryGetMod("tMx", out Mod tMxmt) && tMxmt.TryFind<ModItem>("MoltenTablet", out ModItem MoltenTablet))
{
recipe.AddIngredient(MoltenTablet.Type, 1);
}
recipe.AddTile(TileID.WorkBenches);
recipe.Register();
} else
{ {
recipe.AddIngredient(SandTablet.Type, 1); Recipe recipe = CreateRecipe();
recipe.AddIngredient(ItemID.IronBar, 10);
recipe.AddIngredient(ItemID.FallenStar, 1);
recipe.AddTile(TileID.WorkBenches);
recipe.Register();
} }
if (ModLoader.TryGetMod("tMx", out Mod tMxtt) && tMxtt.TryFind<ModItem>("ToxicTablet", out ModItem ToxicTablet))
{
recipe.AddIngredient(ToxicTablet.Type, 1);
}
if (ModLoader.TryGetMod("tMx", out Mod tMxmt) && tMxmt.TryFind<ModItem>("MoltenTablet", out ModItem MoltenTablet))
{
recipe.AddIngredient(MoltenTablet.Type, 1);
}
recipe.AddTile(TileID.WorkBenches);
recipe.Register();
} }
} }
} }

View File

@ -1,5 +1,5 @@
displayName = tTP displayName = tTP
author = mikx author = mikx
version = 1.0.0 version = 1.1.0
modReferences = tMx modReferences = tMx
dllReferences = Newtonsoft.Json dllReferences = Newtonsoft.Json

22
tTPConfigs.cs Normal file
View File

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Terraria.ModLoader.Config;
namespace tTP
{
public class tTPConfigs : ModConfig
{
[Header("Craft")]
[Label("Use tMx Tablets")]
[Tooltip("Use tMX 4 Tablets to craft a Personal Teleporter. If false, will use a recipe with vanilla materials.")]
[DefaultValue(true)]
public bool UsetMxTablets;
public override ConfigScope Mode => (ConfigScope)0;
}
}