Jump to content

Setting textures depending on metadata not working?


TheNuclearDuck

Recommended Posts

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.

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