Jump to content

Making custom armor


xcoopergangx

Recommended Posts

Okay this may seem realy noobish but I need help with creating custom armor (put facepalm gif here)

Does anybody know whats wrong with this line of code here

 

@Override

public String getArmorTexture(ItemStack itemstack) {  (<-------------- I removed the add overide and that went away)

if(itemstack.itemID == TitaniumMod.TitanHelmet.itemID || itemstack.itemID == TitaniumMod.TitanPlate.itemID || itemstack.itemID == TitaniumMod.TitanBoots.itemID){

return <------------ this method must return a result of type string

}

 

 

this from my main mod class

//armor

 

TitanHelmet = new TitanArmor(3457, TitanHelmet, proxy.addArmor(""), 0).setUnlocalizedName("");

TitanPlate = new TitanArmor(3458, TitanPlate, proxy.addArmor(""), 1).setUnlocalizedName("");

TitanLegs = new TitanArmor(3459, TitanLegs, proxy.addArmor(""), 2).setUnlocalizedName("");

TitanBoots = new TitanArmor(3460, TitanBoots, proxy.addArmor(""), 3).setUnlocalizedName("");

 

Link to comment
Share on other sites

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

 

 

TitanBoots = new TitanArmor(2040, TitanArmor, 6, 3).setUnlocalizedName("titaniumboots");

this works for me

Link to comment
Share on other sites

okay now its just purple and black squares. I put it in my items folder but now it says this

 

 

2013-07-12 09:37:21 [iNFO] [Minecraft-Client] Reloading ResourceManager: Default, FMLFileResourcePack:titaniummod

2013-07-12 09:37:21 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: minecraft:textures/items/MISSING_ICON_ITEM_2296_titaniumboots.png

2013-07-12 09:37:21 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: minecraft:textures/items/MISSING_ICON_ITEM_2293_tianiumhelmet.png

2013-07-12 09:37:21 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: minecraft:textures/items/MISSING_ICON_ITEM_2295_titaniumlegs.png

2013-07-12 09:37:21 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: minecraft:textures/items/MISSING_ICON_ITEM_2294_titaniumplate.png

 

 

I was able ot fix the missing texture but it shows up on my body as nothing any idea how to render it?

 

whats the MISSING_ICON_ITEM_2294 from

 

armor class

 

package minecraftmod;

 

import net.minecraft.client.renderer.texture.IconRegister;

import net.minecraft.item.EnumArmorMaterial;

import net.minecraft.item.ItemArmor;

 

public class TitanArmor extends ItemArmor{

 

        public TitanArmor (int par1, EnumArmorMaterial par2EnumArmorMaterial,

                        int par3, int par4) {

                super(par1, par2EnumArmorMaterial, par3, par4);

        }

     

        public void updateIcons(IconRegister iconRegister) {

       

                        itemIcon = iconRegister.registerIcon("titaniummod:titanboots");

                     

                            itemIcon = iconRegister.registerIcon("titaniummod:titanhelm");

                       

                                itemIcon = iconRegister.registerIcon("titaniummod:titanlegs");

                         

                                    itemIcon = iconRegister.registerIcon("titaniummod:titanplate");

        }}

 

Main class

 

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

 

TitanHelmet = new TitanArmor(2037, TitanArmor, 6, 0).setUnlocalizedName("tianiumhelmet");

TitanPlate = new TitanArmor(2038, TitanArmor, 6, 1).setUnlocalizedName("titaniumplate");

TitanLegs = new TitanArmor(2039, TitanArmor, 6, 2).setUnlocalizedName("titaniumlegs");

TitanBoots = new TitanArmor(2040, TitanArmor, 6, 3).setUnlocalizedName("titaniumboots");

 

 

 

 

 

Link to comment
Share on other sites

 

package minecraftmod;

 

import net.minecraft.client.renderer.texture.IconRegister;

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 void registerIcons(IconRegister IconRegister)

    {

    //itemIcon = par1IconRegister.registerIcon("minecraftmod:titanhelmet");

    //}

 

//public void registerIcons(IconRegister iconRegister)

//{

switch (armorType){

case 0:

        itemIcon = IconRegister.registerIcon("titaniummod:titanhell");

        break;

case 1:

itemIcon = IconRegister.registerIcon("titaniummod:titanchest");

        break;

case 2:

itemIcon = IconRegister.registerIcon("titaniummod:titaniumlegs");

        break;

case 3:

itemIcon = IconRegister.registerIcon("titaniummod:titaniumboots");

        break;

}

}

 

}

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Is this better your highness      \0/

                                                  | |                                   

                                                  _||_

 

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.