Jump to content

Recommended Posts

Posted

Hello everyone.

 

I was wondering how I would set the metadata for a block as an ItemBlock. Normally this doesn't matter, but when it has multiple textures, specifically, a front texture, I want to know how I orientate it in the players inventory. Currently, all the icons are just the default blockIcon (I normally use this icon as the back, and sides). I can't figure out how vanilla blocks such as the furnace, dispenser, or piston do it.

 

Thanks.

I ask complicated questions, and apparently like to write really long detailed posts. But I also help others when I can.

Posted

Hi

 

I think you might be confusing metadata with side?  getIconFromDamage (eg see ItemCloth) can be used to "convert" the item damage into the block metadata, but I don't think this is what you want. 

 

I think you need to either choose your side orientations so that the default rendering (metadata = 0) shows the faces you want rendered in the inventory.  You can override getIconFromDamage to return a different "fake" metadata for your block so that it renders the sides you want, if you're not actually using metadata for your item.

 

FYI the rendering for ItemBlocks is done in

RenderBlocks.renderBlockAsItem()

 

-TGG

 

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.