Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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.

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.