tModLoader Terraria Recipes and Items

HiKoNe

Steampunker
icon.png

Terraria Recipes and Items
v0.1.4.0, Terraria 1.3.5.3
tModLoader v0.11.7.7

Client Side Only

Download on Mod Browser​
This mod adds a system for:
- advanced viewing items and recipes

Check Key Bindings for settings key:
- Use "R" on Item to view Recipe.
- Use "U" on Item to view Usage.

Check Mod Settings for Info Display:
- View ID on Item.
- View Mod Name on Item.

1. Added new Buttons
1590262092395.png

-TRaIItems: Open/Close items grid.
-TRaIConfig: Open configs for you.

2. Items Grid and Search
1590262350059.png

Search for Items:
-Use NAME for search item name.
-Use @MODNAME for search mod.
-Use #TOOLTIP for search tooltip.
-Use $CLASSES for search classes weapon. ($magic, $throwing, $summon, $ranged, $melee)
-Use %NUMBER for search damage. (%1, %>1, %<1)
-Use &. (and)
-Use |. (or)

3. Recipe view
1590263037214.png

For view Recipe:
-Use "R" on Item.
-Use Left Mouse Button on Item.
-Use Shift + "U" on Item.
For view Usage:
-Use "U" on Item.
-Use Right Mouse Button on Item.
-Use Shift + "R" on Item.
You can Add your Recipe in this mod from Another Mod.
Use this code (When your recipe is already added):
C#:
Mod trai = ModLoader.GetMod("TRaI");
if (trai != null)
{
    //From Label
    trai.Call(
        "AddLabel_" + string, //Mod Name
        string, //Hover Item Name
        Texture2D, //Item Texture
        int //Tile ID
    );
    //From Recipe
    trai.Call(
        "AddRecipe_" + string, //Mod Name
        int, //Recipe Count
        Rectangle[], //ITEM: X, Y - Position
        Item[], //ITEM: Item
        bool[], //ITEM: If Item is Output
        float[], //ITEM: Chance (1f = 100%)
        float[], //ITEM: Scale
        Texture2D[], //ITEM: Background Texture (null for Terraria Background)
        Rectangle[], //STRING: X, Y - Position
        string[], //STRING: String
        float[], //STRING: Scale
        Rectangle[], //TEXTURE: X, Y - Position
        Texture2D[], //TEXTURE: Texture
        int[], //Recipe Tile IDs
        int //Recipe Height
    );
}
Call in:
C#:
//In MOD Class
//or
public override void PostAddRecipes()
//or
public override void AddRecipes()
//or
public override void PostSetupContent()
You can check my Source Code.
Or this Example code:
C#:
        public override void AddRecipes()
        {
            Mod trai = ModLoader.GetMod("TRaI");
            if (trai != null)
            {
                /*
                 * {0} - String (AddLabel_MODNAME)
                 * {1} - String (Name)
                 * {2} - Texture (Texture)
                 * {3} - Ints[] (Tiles)
                 */
                var item = new Item();
                for (int j = 0; j < ItemLoader.ItemCount; j++)
                {
                    item.SetDefaults(j);
                    if (item.createTile == MaceratorRecipes.tile[0])
                    {
                        trai.Call(
                            "AddLabel_" + Name, //{0}
                            item.HoverName, //{1}
                            Main.itemTexture[item.type], //{2}
                            MaceratorRecipes.tile[0] //{3}
                        );
                        break;
                    }
                }
                /*
                 * {0} - String (AddRecipe_MODNAME)
                 * {1} - Int (Count Recipes)
                 * {2}{3}{4}{5}{6}{7} - Rectangles[], Items[], Bools[], Floats[], Floats[], Textures[] (Items)
                 * {8}{9}{10} - Rectangles[], Strings[], Floats[] (Strings)
                 * {11}{12} - Rectangles[], Textures[] (Textures)
                 * {13} - Ints[] (Required Tiles)
                 * {14} - Int (Height Recipe)
                 */
                for (int i = 0; i < MaceratorRecipes.numRecipes; i++)
                {
                    var r = MaceratorRecipes.maceratorRecipes[i];

                    var itemsRect = new List<Rectangle>() { new Rectangle(0, 0, 0, 0) };
                    var items = new List<Item>() { r.itemInput };
                    var bools = new List<bool>() { false };
                    var floats = new List<float>() { 1f };
                    var scale = new List<float>() { 0.67f };
                    var texture = new List<Texture2D>() { null };

                    var stringsRect = new List<Rectangle>() {
                        new Rectangle(10, 52, 0, 0),
                        new Rectangle(10, 72, 0, 0),
                        new Rectangle(10, 92, 0, 0)
                    };
                    var strings = new List<string>() {
                        "Energy total: " + r.energyUsage * r.craftTime + " IE",
                        "Enrgy consume: " + r.energyUsage + " IE/sec",
                        "Craft time: " + r.craftTime + " sec"
                    };
                    var scales = new List<float>() {
                        1f,
                        1f,
                        1f
                    };

                    var size = 52 * 0.67f;
                    for (int j = 0; j < r.itemOutput.Length; j++)
                    {
                        itemsRect.Add(new Rectangle((int)size + 5 + (int)(size * j), 0, 0, 0));
                        items.Add(r.itemOutput[j]);
                        bools.Add(true);
                        floats.Add(r.outputChance[j]);
                        scale.Add(0.67f);
                        texture.Add(null);
                    }

                    trai.Call(
                        "AddRecipe_" + Name, //{0}
                        MaceratorRecipes.numRecipes, //{1}
                        itemsRect.ToArray(), //{2}
                        items.ToArray(), //{3}
                        bools.ToArray(), //{4}
                        floats.ToArray(), //{5}
                        scale.ToArray(), //{6}
                        texture.ToArray(), //{7}
                        stringsRect.ToArray(), //{8}
                        strings.ToArray(), //{9}
                        scales.ToArray(), //{10}
                        null, //{11}
                        null, //{12}
                        MaceratorRecipes.tile.ToArray(), //{13}
                        118 //{14}
                    );
                }
            }
        }
v0.1:
-Mod Started!
v0.1.0.1:
-Added Site.
v0.1.2.0:
-Added GitHub.
-Added Icon.

v0.1.3.0
-Added Mod Integration.
-Added Description for Recipes.
-Fixed code.

v0.1.4.0
-Changed to Client Side only mod.
-Fixed server disabling mod.
 
Last edited:
Being a avid modded Minecraft player I absolutely love this mod, thank you so much for bringing NEI/JEI to Terraria!
 
Is there any way to turn off the ID numbers ?
All I want with this mod is to know how to do recipes for items I want to craft.
I am seeing a lot of items with ID numbers and its making a mess in the game visually.
Thanks :)
 
Is there any way to turn off the ID numbers ?
All I want with this mod is to know how to do recipes for items I want to craft.
I am seeing a lot of items with ID numbers and its making a mess in the game visually.
Thanks :)
Yes, you can. In settings.
1593453966206.png
 
There seems to be an issue when using the gui scale slider, as when it's anything above default 100 the menus are unable to be interacted with. Otherwise, it's a nice mod that's quite like N/J/R/whatever-letter-prefix-it-is-now/EI.
 
This mod will have a feature to view unusual recipes from other mods.
And in the future I will add loot preview: NPC, Crate, Extractor, Chest, etc.
This mod need for me...
 
Hey just found this mod on 1.4 tmodloader and checked if it is available for 1.3.5 and it is which is cool. I've run into a few issues which could be from other mods causing issues but they are Boss bags have so much loot to show that they flash all the items really fast back and forth and then I had a crash when trying to view a big amount of recipes I think 40 wide x 10 high, I have a big monitor which would be okay its just I think something caused the issue I'm not sure what it could be, my guess it was an interaction with another mod.
 
Back
Top Bottom