Followed a tutorial here about adding armor and textures to the armor. I ended with this code. When I load into minecraft, the chestpiece is black with purple arms, everything else is black. I attached the two armor files to this post. They are in my textures/armors folder. And, as a quick question, if I setTextureName() in my WheelOfTime main java file, do I need the RegisterIcons() at the bottom? I was following MyCrayfish's tutorials, but he stopped 1.7.10 and moved onto 1.8 so I had to use different tutorials.
package projectmayhem1983.wheeloftime.armor.whitecloak;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import projectmayhem1983.wheeloftime.WheelOfTime;
public class whitecloakArmor extends ItemArmor{
private String[] armourTypes = new String [] {"whitecloakHelm", "whitecloakChest", "whitecloakLegs", "whitecloakBoots"};
public whitecloakArmor(ArmorMaterial armorMaterial, int renderIndex, int armourType){
super(armorMaterial, renderIndex, armourType);
}
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String layer){
if (stack.getItem().equals(WheelOfTime.whitecloakHelm) ||
stack.getItem().equals(WheelOfTime.whitecloakChest)||
stack.getItem().equals(WheelOfTime.whitecloakBoots)){
return "wot:itemwhitecloak1";
}
if (stack.getItem().equals(WheelOfTime.whitecloakLegs)){
return "wot:itemwhitecloak2";
}
else return null;
}
@Override
public void registerIcons(IIconRegister reg){
if(this == WheelOfTime.whitecloakHelm)
this.itemIcon = reg.registerIcon("wot:itemwhitecloakhelm");
if(this == WheelOfTime.whitecloakChest)
this.itemIcon = reg.registerIcon("wot:itemwhitecloakchest");
if(this == WheelOfTime.whitecloakLegs)
this.itemIcon = reg.registerIcon("wot:itemwhitecloaklegs");
if(this == WheelOfTime.whitecloakBoots)
this.itemIcon = reg.registerIcon("wot:itemwhitecloakboots");
}
}
It seems you might have messed up the path to the armor textures. In my mod, for instance, I use the following path: "gases:textures/models/armor/respirator_primitive.png". You might have to add the necessary folder names and append the file extension too.
Some minor unrelated advice:
There is no need to use .equals() to check if the itemstack's item is a specific item, using == is completely fine.
I also highly advise you to find another way to associate your textures with the different armor pieces. Chained if statements like that are generally ugly. For instance, you could remove your override of registerIcons if you do something like this instead:
Still isn't working. My code now looks like this...
package projectmayhem1983.wheeloftime.armor.whitecloak;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import projectmayhem1983.wheeloftime.WheelOfTime;
public class whitecloakArmor extends ItemArmor{
private String[] armourTypes = new String [] {"whitecloakHelm", "whitecloakChest", "whitecloakLegs", "whitecloakBoots"};
public whitecloakArmor(ArmorMaterial armorMaterial, int renderIndex, int armourType){
super(armorMaterial, renderIndex, armourType);
}
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String layer){
if (stack.getItem() == (WheelOfTime.whitecloakHelm) ||
stack.getItem() == (WheelOfTime.whitecloakChest)||
stack.getItem() == (WheelOfTime.whitecloakBoots)){
return "wot:textures/models/armor/itemwhitecloak1.png";
}
if (stack.getItem().equals(WheelOfTime.whitecloakLegs)){
return "wot:textures/models/armor/itemwhitecloak2.png";
}
else return null;
}
}
I tried making the extra folders you have, and I tried with and without the .png at the end of the itemwhitecloak1 + itemwhitecloak2. And I tried with and without adding the extra .png on my texture (they show up as .png.png after I add the .png to the end. I included a snip of my Project Explorer so you can see I have the textures in the right spot
With the way you have currently placed your textures, the respective paths are "wot:textures/models/armor/whitecloak1.png" and "wot:textures/models/armor/whitecloak2.png". The texture paths you use have to match the file names, not the item ID.
You are a saint. Can't believe I didn't notice the extra "item" in the code. The armor shows up perfectly now! Well, almost, I textured the front side of the chest onto the back, so gotta go fix that, but other than that, its awesome!! Thank you for ending my suffering.
Followed a tutorial here about adding armor and textures to the armor. I ended with this code. When I load into minecraft, the chestpiece is black with purple arms, everything else is black. I attached the two armor files to this post. They are in my textures/armors folder. And, as a quick question, if I setTextureName() in my WheelOfTime main java file, do I need the RegisterIcons() at the bottom? I was following MyCrayfish's tutorials, but he stopped 1.7.10 and moved onto 1.8 so I had to use different tutorials.
It seems you might have messed up the path to the armor textures. In my mod, for instance, I use the following path: "gases:textures/models/armor/respirator_primitive.png". You might have to add the necessary folder names and append the file extension too.
Some minor unrelated advice:
There is no need to use .equals() to check if the itemstack's item is a specific item, using == is completely fine.
I also highly advise you to find another way to associate your textures with the different armor pieces. Chained if statements like that are generally ugly. For instance, you could remove your override of registerIcons if you do something like this instead:
ok I thought so, the tutorial I followed first from MrCrayfish had me set them in the WheelOfTime.java like this...
So, I'll remove those texture statements, and try changing the path to a complete path, then ill come back and let you know how it worked out.
Still isn't working. My code now looks like this...
I tried making the extra folders you have, and I tried with and without the .png at the end of the itemwhitecloak1 + itemwhitecloak2. And I tried with and without adding the extra .png on my texture (they show up as .png.png after I add the .png to the end. I included a snip of my Project Explorer so you can see I have the textures in the right spot
With the way you have currently placed your textures, the respective paths are "wot:textures/models/armor/whitecloak1.png" and "wot:textures/models/armor/whitecloak2.png". The texture paths you use have to match the file names, not the item ID.
You are a saint. Can't believe I didn't notice the extra "item" in the code. The armor shows up perfectly now! Well, almost, I textured the front side of the chest onto the back, so gotta go fix that, but other than that, its awesome!! Thank you for ending my suffering.