Okay so, with the past couple updates of forge, they have fixed armor rendering with textures.
Let's begin.
Step 1:
Go to your ItemArmor.class or whatever it's called for you.
The way I did it was by adding a String to the constructor.
public class RioVArmor extends ItemArmor
{
public String armorNamePrefix;
public EnumArmorMaterial material;
public RioVArmor(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4, String armornamePrefix)
{
super(par1, par2EnumArmorMaterial, par3, par4);
this.material = par2EnumArmorMaterial;
par2EnumArmorMaterial.getDamageReductionAmount(par4);
this.setMaxDamage(par2EnumArmorMaterial.getDurability(par4));
this.maxStackSize = 1;
this.setCreativeTab(TheMistsOfRioV.tab);
armorNamePrefix = armornamePrefix;
}
public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer)
{
if (stack.toString().contains("leggings"))
{
return "RioV:" + armorNamePrefix + "_2.png";
}
if (stack.toString().contains("Leggings"))
{
return "RioV:" + armorNamePrefix + "_2.png";
}
return "RioV:" + armorNamePrefix + "_1.png";
}
Which means my item declaration looks like this:
public static Item amethystHelmet = new RioVArmor(2000, AmethystArmorMaterial(your armor material), "amethyst").setUnlocalizedName("blahblahblah");
Now, let's go back to the getAmorTexture method in our armor class.
Ever since 1.6.1 getArmorTextureFile has changed to getArmorTexture with a few more variables.
I set my texture directory as RioV:(armorNamePrefix)_1.png/_2.png
The stack.toString().contains("Leggings") means if the unlocalizedName has leggings and/or Leggings in it, it will use the amethyst_2.png to render the leggings as normal.
The texture directory will be in mcp/src/minecraft/assets/riov/(armor pngs) as RioV: is my modID which means in the texture directory, RioV will be lowercase.
I tried to make this sound not as confusing as possible. I hope this helped.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumOkay so, with the past couple updates of forge, they have fixed armor rendering with textures.
Let's begin.
Step 1:
Go to your ItemArmor.class or whatever it's called for you.
The way I did it was by adding a String to the constructor.
public class RioVArmor extends ItemArmor { public String armorNamePrefix; public EnumArmorMaterial material; public RioVArmor(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4, String armornamePrefix) { super(par1, par2EnumArmorMaterial, par3, par4); this.material = par2EnumArmorMaterial; par2EnumArmorMaterial.getDamageReductionAmount(par4); this.setMaxDamage(par2EnumArmorMaterial.getDurability(par4)); this.maxStackSize = 1; this.setCreativeTab(TheMistsOfRioV.tab); armorNamePrefix = armornamePrefix; } public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) { if (stack.toString().contains("leggings")) { return "RioV:" + armorNamePrefix + "_2.png"; } if (stack.toString().contains("Leggings")) { return "RioV:" + armorNamePrefix + "_2.png"; } return "RioV:" + armorNamePrefix + "_1.png"; }Which means my item declaration looks like this:
public static Item amethystHelmet = new RioVArmor(2000, AmethystArmorMaterial(your armor material), "amethyst").setUnlocalizedName("blahblahblah");Now, let's go back to the getAmorTexture method in our armor class.
Ever since 1.6.1 getArmorTextureFile has changed to getArmorTexture with a few more variables.
I set my texture directory as RioV:(armorNamePrefix)_1.png/_2.png
The stack.toString().contains("Leggings") means if the unlocalizedName has leggings and/or Leggings in it, it will use the amethyst_2.png to render the leggings as normal.
The texture directory will be in mcp/src/minecraft/assets/riov/(armor pngs) as RioV: is my modID which means in the texture directory, RioV will be lowercase.
I tried to make this sound not as confusing as possible. I hope this helped.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumBronzeArmor
package mods.cyphereion.cyphscape.core; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.item.EnumArmorMaterial; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; public class BronzeArmor extends ItemArmor{ public BronzeArmor(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) { super(par1, par2EnumArmorMaterial, par3, par4); this.setCreativeTab(Core.tabCyphScape); } public String getArmorTextureFile(ItemStack itemstack) { if(itemID == Core.BronzeFullHelmet.itemID){ return Core.DirTexPre + Core.ArmorTexPreBronze + "_1.png"; }if(itemID == Core.BronzePlateChest.itemID){ return Core.DirTexPre + Core.ArmorTexPreBronze + "_1.png"; }if(itemID == Core.BronzeBoots.itemID){ return Core.DirTexPre + Core.ArmorTexPreBronze + "_1.png"; }if(itemID == Core.BronzePlateLegs.itemID){ return Core.DirTexPre + Core.ArmorTexPreBronze + "_2.png"; }else{ return null; } } }Base Class
BronzeFullHelmet = new BronzeArmor(2015, Core.BRONZE, proxy.addArmor("Bronze Full Helm"), 0).setUnlocalizedName("CyphScape_BronzeFullHelm"); BronzePlateChest = new BronzeArmor(2016, Core.BRONZE, proxy.addArmor("Bronze Platechest"), 1).setUnlocalizedName("CyphScape_BronzeChestPlate"); BronzePlateLegs = new BronzeArmor(2017, Core.BRONZE, proxy.addArmor("Bronze Platelegs"), 2).setUnlocalizedName("CyphScape_BronzePlateLegs"); BronzeBoots = new BronzeArmor(2018, Core.BRONZE, proxy.addArmor("Bronze Boots"), 3).setUnlocalizedName("CyphScape_BronzeBoots");Note: the texture locations are correct.