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

I have this block, which has multiple subtypes using metadata (15 different subtypes). I am using the following code:

public int getBlockTextureFromSideAndMetadata(int side, int metadata)
    {
	switch(side)
	{
		case 0: return 32;
		case 1: return 0 + metadata;
		default: return 16;
	}
    }

to change the top side texture depending on the metadata. I am also using this code:

public int getBlockTexture(IBlockAccess worldAccess, int i, int j, int k, int l)
{
	return getBlockTextureFromSideAndMetadata(l, worldAccess.getBlockMetadata(i, j, k));
}

Which should, as far as I know, do what I want it to do. However, for some reason, the texture only changes in the inventory slots, and when seen in the player's hand. When placed down, it stays at the texture for the block without metadata.

 

Any ideas why this is happening? I think I've given all the relevant code, but if you need anything else, just tell me.

  • Author

Update: I now think I know why this is happening, for some reason whatever block metadata the block in your inventory has, the block always seems to place without any metadata at all.

 

Any ideas?

You also need an ItemBlock when working with metadata placed blocks, look up a tutorial on google

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.