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.