Jump to content

[1.6][HELP] Making/rendering custom armor


xcoopergangx

Recommended Posts

My armor is not rendering does anybody know how ot render it.

 

armor class

package minecraftmod;

import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class TitanArmor extends ItemArmor{
    public final int armorType;
    private final EnumArmorMaterial material;


//public static final String[] ArmourArray = new String[]{"titanHelmet", "titanLeggings", "titanBoots", "titanlChest"};
    
    //@SideOnly(Side.CLIENT)
    //private Icon[] iconArray;

public TitanArmor(int itemId, EnumArmorMaterial EnumArmorMaterial,
		int par3, int par4) {
	super(itemId, EnumArmorMaterial, par3, par4);
        this.material = getArmorMaterial();
        this.armorType = par4;
}

    public EnumArmorMaterial getArmorMaterial()
    {
        return this.material;
    } public void updateIcons(IconRegister iconRegister) {
        
    }

   @Override
public String getArmorTexture(ItemStack par1, Entity entity, int slot, int layer) {
            
            if(itemID == TitaniumMod.TitanHelmet.itemID || par1.itemID == TitaniumMod.TitanLegs.itemID ||
                            par1.itemID == TitaniumMod.TitanPlate.itemID)
            {
                    return "titaniummod:textures/armor/blue_1";
            }
            
            if(itemID == TitaniumMod.TitanBoots.itemID)
            {
                    return "titaniummod:textures/armor/blue_2";}
		return field_111218_cA;



            }
           
    public void registerIcons(IconRegister IconRegister)
    {
    //itemIcon = par1IconRegister.registerIcon("minecraftmod:titanhelmet");
    //}

//public void registerIcons(IconRegister iconRegister)
//{
	switch (armorType){
	case 0:
        itemIcon = IconRegister.registerIcon("titaniummod:titaniumhelmet");
        break;
	case 1:
		itemIcon = IconRegister.registerIcon("titaniummod:titaniumchest");
        break;
	case 2:
		itemIcon = IconRegister.registerIcon("titaniummod:titaniumlegs");
        break;
	case 3:
		itemIcon = IconRegister.registerIcon("titaniummod:titaniumboots");
        break;
	}
}

}






























 

 

 

 

Main mod class

 

 

//armor

EnumArmorMaterial TitanArmor = EnumHelper.addArmorMaterial("TITANIUM", 12, new int[] {2, 5, 4, 2}, 9);

TitanHelmet = new TitanArmor(2293, TitanArmor, 6, 0).setUnlocalizedName("titaniumhelmet");
TitanPlate = new TitanArmor(2294, TitanArmor, 6, 1).setUnlocalizedName("titaniumchest");
TitanLegs = new TitanArmor(2295, TitanArmor, 6, 2).setUnlocalizedName("titaniumlegs");
TitanBoots = new TitanArmor(2296, TitanArmor, 6, 3).setUnlocalizedName("titaniumboots");

 

 

clientproxy(not sure if needed)

 

package minecraftmod;

import cpw.mods.fml.common.registry.EntityRegistry;
import net.minecraftforge.client.MinecraftForgeClient;
import minecraftmod.CommonProxy;
import minecraftmod.RenderShuriken;
import minecraftmod.EntityShuriken;
import minecraftmod.Shuriken;
import cpw.mods.fml.client.registry.RenderingRegistry;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.item.Item;
import net.minecraft.src.ModLoader;
import cpw.mods.fml.common.registry.EntityRegistry;

public class ClientProxy extends CommonProxy {


public int addArmor(String armor){
	return RenderingRegistry.addNewArmourRendererPrefix(armor);
}

// this is an render registry don't put stuff under this unless you want to render items.
        @Override
        public void registerRenderers() {
                // This is for rendering entities and so forth later on
        EntityRegistry.registerModEntity(EntityShuriken.class, "Shuriken", 49, this, 80, 3, false);
             	super.registerRenderers();	
            EntityRegistry.registerGlobalEntityID(EntityShuriken.class, "Shuriken", ModLoader.getUniqueEntityId());
           

            
}}

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.