Jump to content

Recommended Posts

Posted

ive made multiple barks(items) and i have done all the code for the and the textures are working and everything.

 

the only thing is, there is no name for it

 

 

 

public class ItemTreeBark extends Item

{

public static final String[] barkType = new String[] {"Oak", "Spruce", "Birch", "Jungle"};

 

public ItemTreeBark(int id)

{

super(id);

this.setCreativeTab(SkyCraft.tabSkyCraftItems);

this.setMaxDamage(0);

this.setHasSubtypes(true);

this.setIconCoord(0, 1);

this.setItemName("Bark");

}

 

@SideOnly(Side.CLIENT)

    public int getIconFromDamage(int par1)

    {

        int var2 = MathHelper.clamp_int(par1, 0, 3);

        return this.iconIndex + var2 % 1 * 1 + var2 / 1;

    }

 

public String getItemNameIS(ItemStack par1ItemStack)

    {

        int var2 = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, 3);

        return barkType[var2] + " " + super.getItemName();

    }

 

@SideOnly(Side.CLIENT)

public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)

{

    for (int var4 = 0; var4 < 4; ++var4)

    {

        par3List.add(new ItemStack(par1, 1, var4));

        }

}

 

public String getTextureFile()

    {

            return CommonProxySkyCraft.Items_PNG;

    }

}

 

 

 

 

i think its got something to do with the getItemNameIS()

 

Thanks in advance

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.