Jump to content

1.6.2 Custom Armor same name !


Heltrato
 Share

Recommended Posts

Hi Guys i got a bug with my custom armor it has a same name i dont know if its the language registry or my armor class but please check it out and help

 

Armor.class

 

package MHF.Item;

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;

public class KirinSet extends ItemArmor{

public KirinSet(int par1, EnumArmorMaterial par2EnumArmorMaterial,
		int par3, int par4) {
	super(par1, par2EnumArmorMaterial, par3, par4);

}
@Override
public String getArmorTexture(ItemStack stack, Entity ent, int slot, int layer)
{
	if(itemID == MainItem.kirinhelm.itemID  || itemID == MainItem.kirincape.itemID || itemID == MainItem.kirinboots.itemID)
	{
		return "monsterhunter:textures/armor/kirin_1.png";
	}
	if(itemID == MainItem.kirinshorts.itemID)
	{
		return "monsterhunter:textures/armor/kirin_2.png";
	}
	else return null;
}
  

public void registerIcons(IconRegister reg)
{
   if(itemID == MainItem.kirinhelm.itemID)
   {
	   itemIcon = reg.registerIcon("monsterhunter:kirin_helm");
   }
   else if(itemID == MainItem.kirincape.itemID)
   {
	   itemIcon = reg.registerIcon("monsterhunter:kirin_chest");
  	   }
   else if(itemID == MainItem.kirinshorts.itemID)
   {
	   itemIcon = reg.registerIcon("monsterhunter:kirin_leg");
  	   }
   else if(itemID == MainItem.kirinboots.itemID)
   {
	   itemIcon = reg.registerIcon("monsterhunter:kirin_boots");
  	   }
}


}




 

 

 

MainItem.class

 

public class MainItem
{
public static Item kirinhelm;
    public static Item kirincape;
    public static Item kirinshorts;
    public static Item kirinboots;
}

public void init {

//Armors
	 kirinhelm = new KirinSet(15000, MonsterHunterFrontier.armorKirin, 0, 0);
	 kirincape = new KirinSet(15001, MonsterHunterFrontier.armorKirin, 0, 1);
	 kirinshorts = new KirinSet(15002, MonsterHunterFrontier.armorKirin,0,2);
	 kirinboots = new KirinSet(15003, MonsterHunterFrontier.armorKirin,0,3);


		//Armor
		LanguageRegistry.addName(kirinhelm, "Kirin Helm");
		LanguageRegistry.addName(kirincape, "Kirin Chest");
		LanguageRegistry.addName(kirinshorts, "Kirin Shorts");
		LanguageRegistry.addName(kirinboots, "Kirin Boots");

	  
	 }


Link to comment
Share on other sites

Bro is this the same with the Meta Data Block Coz i got the same name with this

BlockWood


package MHF.Block;

import MHF.MonsterHunterFrontier;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.util.MathHelper;

public class BlockWyverniaWood extends Block
{
    /** The type of tree this block came from. */
    public static final String[] woodType = new String[] {"peach", "snow"};
    public static final String[] woodTextureTypes = new String[] {"wood_peach", "wood_snow"};
    @SideOnly(Side.CLIENT)
    private Icon[] iconArray;

    public BlockWyverniaWood(int par1)
    {
        super(par1, Material.wood);
        this.setCreativeTab(MonsterHunterFrontier.tabMonsterHunterBlocks);
        this.setStepSound(soundWoodFootstep);
    }
    public String getUnlocalizedName(ItemStack par1ItemStack)
   {
       int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, 15);
       return super.getUnlocalizedName() + "." + woodType[i];
   }

    @SideOnly(Side.CLIENT)

    /**
     * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
     */
    @Override
public Icon getIcon(int side, int meta)
{
	if (meta < 0 || meta >= iconArray.length) {
		meta = 0;
	}

	return iconArray[meta];
}


    /**
     * Determines the damage on the item the block drops. Used in cloth and wood.
     */
    public int damageDropped(int par1)
    {
        return par1;
    }

    public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)
    {
        par3List.add(new ItemStack(par1, 1, 0));
        par3List.add(new ItemStack(par1, 1, 1));
    }

    @SideOnly(Side.CLIENT)

    /**
     * When this method is called, your block should register all the icons it needs with the given IconRegister. This
     * is the only chance you get to register icons.
     */
    @Override

    public void registerIcons(IconRegister par1IconRegister)
    {
        this.iconArray = new Icon[woodTextureTypes.length];

        for (int i = 0; i < this.iconArray.length; ++i)
        {
            this.iconArray[i] = par1IconRegister.registerIcon("monsterhunter:" + woodTextureTypes[i]);
        }
    }
}


 

 

 

MainBlock.class

 

 



blockwyverniawood = new BlockWyverniaWood(2340).setHardness(2.0F).setResistance(5.0F).setUnlocalizedName("wood");

GameRegistry.registerBlock(blockwyverniawood, "wood");

	    LanguageRegistry.addName(new ItemStack(blockwyverniawood ,1,  0), "Wyvernia Wood Plank");
	    LanguageRegistry.addName(new ItemStack(blockwyverniawood ,1,  1), "Wyvernia Wood Planks");

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
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.

 Share



×
×
  • Create New...

Important Information

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