private void AutoloadItem(Type type) { ModItem item = (ModItem)Activator.CreateInstance(type); item.mod = this; string name = type.Name; string texture = (type.Namespace + "." + type.Name).Replace('.', '/'); IList <EquipType> equips = new List <EquipType>(); if (item.Autoload(ref name, ref texture, equips)) { AddItem(name, item, texture); if (equips.Count > 0) { EquipLoader.idToSlot[item.item.type] = new Dictionary <EquipType, int>(); foreach (EquipType equip in equips) { string equipTexture = texture + "_" + equip.ToString(); string armTexture = texture + "_Arms"; string femaleTexture = texture + "_FemaleBody"; item.AutoloadEquip(equip, ref equipTexture, ref armTexture, ref femaleTexture); int slot = AddEquipTexture(item, equip, name, equipTexture, armTexture, femaleTexture); EquipLoader.idToSlot[item.item.type][equip] = slot; } } string flameTexture = texture + "_" + "Flame"; item.AutoloadFlame(ref flameTexture); if (ModLoader.TextureExists(flameTexture)) { AddFlameTexture(item, flameTexture); } } }