Posted December 12, 201212 yr 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.
December 13, 201212 yr Try making the block tick randomly with setTickRandomly() and set a tickRate i guess. Look at fire or another block that updates http://i.imgur.com/Hppni.png[/img]
December 13, 201212 yr 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?
December 14, 201212 yr 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.