Jump to content

[1.7.2] Custom armor with Overlays


hugo_the_dwarf

Recommended Posts

Hey so I'd like to make two armor classes "ItemArmorMyCustomArmor" and "ItemArmorMyCustomArmorWithOverlay"

 

I found a tutorial on how to make the first armor class (so this means I know I need to look in "myModId:textures/model/armor/" for the layer_1 and 2.png) however it did not explain how to add overlays (I know how to do this for normal items) and looking in the ItemArmor class seems like only CLOTH or leather armor types get the overlays. How ever I do not want vanilla overlays or use CLOTH for all my armor types, I want to make suits of armor that can be customized by the owner (dying leather armor, only now can dye trim and armor base)

 

here is my attempt at the normal armor:

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ee.rot.Rot;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;

public class ItemArmorCustom extends ItemArmor
{

private String texturePath = Rot.MODID+":textures/model/armor/";

public ItemArmorCustom(ItemArmor.ArmorMaterial mat, int wornSlot, String type)
{
	super(mat, 0, wornSlot);
	this.setMaxStackSize(1);
	this.setTextureName(type, wornSlot);
}

private void setTextureName(String type, int armorPart)
{
	switch(armorType)
	{
		case 0:
		case 1:
		case 3:
			this.texturePath += type + "_layer_1.png";
			break;
		case 2:
			this.texturePath += type + "_layer_2.png";
			break;
	}
}

@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister ir)
{
	this.itemIcon = ir.registerIcon(Rot.MODID+":"+this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf('.')+1));
	super.registerIcons(ir);
}

@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot,
		String type)
{
	return texturePath;
}
}

 

If something is wrong or should be done differently being corrected and educated would be much appreciated the tutorial I watched was for 1.6.4 which shouldn't make a difference other then wondering why he made a separate method to set the texture location. 

Link to comment
Share on other sites

ok did some more digging and I found that renderBiped and renderPlayer are what call "getArmorTexture" from Item (which is used mainly in ItemArmor that extends Item)

 

So I guess I need to know how to make a custom renderer for players wearing my armor so I can use more render passes to do my overlays?

Link to comment
Share on other sites

  • 2 weeks later...

Well with some searching I think a few others have asked this question and no response to each one, guess this is impossible or no one knows how?

 

How do I make a suggestion for the forge guys to add something like this in? And if it is How do I go about this path of armor with overlays.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.