superninjaman45 Posted August 9, 2013 Posted August 9, 2013 Hello, I have just started modding with Forge in 1.6.2. Before that I was using Modloader. Now when I switched, I, of course, had lots of issues, most of which I have solved. However I cant get my custom armor to work correctly. Before this I didn't even have an ItemArmor.java, I just had everything done in the main mod file. Now, I think I have created an Armor file that will work, but I don't know what I need in my main mod file. If you could help that would be great. Thanks ItemSapphireArmor Reveal hidden contents package superninjaman45.elvesanddwarves; import net.minecraft.item.EnumArmorMaterial; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; public class ItemSapphireArmor extends ItemArmor{ public ItemSapphireArmor(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) { super(par1, par2EnumArmorMaterial, par3, par4); } public String getArmorTextureFile(ItemStack itemstack) { if(itemstack.itemID == ElvesAndDwarves.SapHelmet.itemID){ return "elvesanddwarves:textures/armor/saparmor_layer_1.png";} if(itemstack.itemID == ElvesAndDwarves.SapBody.itemID){ return "elvesanddwarves:textures/armor/saparmor_layer_1.png";} if(itemstack.itemID == ElvesAndDwarves.SapBoots.itemID){ return "elvesanddwarves:textures/armor/saparmor_layer_2.png";} if(itemstack.itemID == ElvesAndDwarves.SapPants.itemID){ return "elvesanddwarves:textures/armor/saparmor_layer_2.png"; } else return null; } } Here is some bits and pieces from my mod file about the armor. (The entire thing is very large and cluttered with other things) Reveal hidden contents public static final Item SapBody = (new ItemSapphireArmor(2108, EnumArmorMaterial.DIAMOND ,5,1 ).setUnlocalizedName("spbd").func_111206_d("elvesanddwarves:spbd")); public static final Item SapHelmet = (new ItemSapphireArmor(2109,EnumArmorMaterial.DIAMOND ,5,0 ).setUnlocalizedName("sphm").func_111206_d("elvesanddwarves:sphm")); public static final Item SapPants = (new ItemSapphireArmor(2111,EnumArmorMaterial.DIAMOND ,5,2 ).setUnlocalizedName("sppt").func_111206_d("elvesanddwarves:sppt")); public static final Item SapBoots = (new ItemSapphireArmor(2112,EnumArmorMaterial.DIAMOND, 5, 3 ).setUnlocalizedName("spbt").func_111206_d("elvesanddwarves:spbt")); @EventHandler public void load(FMLInitializationEvent event) { proxy.registerRenderers(); // Sapphire Chest Armor ModLoader.addName(SapBody, "Sapphire Chestplate"); ModLoader.addRecipe(new ItemStack(SapBody,1), new Object[]{ "* *", "***", "***", Character.valueOf('*'), Sapphire}); // Sapphire Helmet Armor ModLoader.addName(SapHelmet, "Sapphire Helmet"); ModLoader.addRecipe(new ItemStack(SapHelmet,1), new Object[]{ "***", "* *", " ", Character.valueOf('*'), Sapphire}); // Sapphire Pants Armor ModLoader.addName(SapPants, "Sapphire Leggings"); ModLoader.addRecipe(new ItemStack(SapPants,1), new Object[]{ "***", "* *", "* *", Character.valueOf('*'), Sapphire}); // Sapphire Boots Armor ModLoader.addName(SapBoots, "Sapphire Boots"); ModLoader.addRecipe(new ItemStack(SapBoots,1), new Object[]{ " ", "* *", "* *", Character.valueOf('*'), Sapphire}); ModLoader.addArmor("saparmor"); } Very sorry if this seems very easy or obvious. I has just been a long time since I have fiddled with the armor. Frankly, I am surprised I got this working in Modloader, I am not sure how the ModLoader.addArmor("saparmor"); got the armor set up correctly as I don't refer to "saparmor" anywhere. Also, sorry for using Modloader in my code. Thanks for your help. Quote An average guy who mods Minecraft. If you need help and are willing to use your brain, don't be afraid to ask. Also, check out the Unofficial Minecraft Coder Pack (MCP) Prerelease Center for the latest from the MCP Team! Was I helpful? Leave some karma/thanks!
GotoLink Posted August 10, 2013 Posted August 10, 2013 public String getArmorTextureFile(ItemStack itemstack) I am pretty sure this method do not exist anymore in 1.6. Change to the following: public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) Quote
superninjaman45 Posted August 12, 2013 Author Posted August 12, 2013 Actually it is public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) Quote An average guy who mods Minecraft. If you need help and are willing to use your brain, don't be afraid to ask. Also, check out the Unofficial Minecraft Coder Pack (MCP) Prerelease Center for the latest from the MCP Team! Was I helpful? Leave some karma/thanks!
superninjaman45 Posted August 12, 2013 Author Posted August 12, 2013 Whoops. I had the texture in the wrong folder. Sorry about that. Though for some reason, when my character puts on boots it just makes a bigger pair of leggings. Working on that. Quote An average guy who mods Minecraft. If you need help and are willing to use your brain, don't be afraid to ask. Also, check out the Unofficial Minecraft Coder Pack (MCP) Prerelease Center for the latest from the MCP Team! Was I helpful? Leave some karma/thanks!
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.