I've got a couple of blocks I'm working on, in two seperate mods, and both are demonstrating the same thing; if, when I get the icons, I set them to a side in particular, the face shows in the inventory bar correctly.
However, if it gets decided via metadata (like the furnace, along with other tutorials I've found online), the face is missing completely from the inventory bar. I've tried all variations I can think of, to no avail.
I don't want to hard-code the sides in, because I want it to be directional, like most other blocks. How can I set it to show the face of my block in my inventory, without giving up the metadata? I've googled all the terms I could think of, to no avail. Thanks
Hey guys,I've got a couple of blocks I'm working on, in two seperate mods, and both are demonstrating the same thing; if, when I get the icons, I set them to a side in particular, the face shows in the inventory bar correctly.However, if it gets decided via metadata (like the furnace, along with other tutorials I've found online), the face is missing completely from the inventory bar. I've tried all variations I can think of, to no avail.Here's my code:
I don't want to hard-code the sides in, because I want it to be directional, like most other blocks. How can I set it to show the face of my block in my inventory, without giving up the metadata? I've googled all the terms I could think of, to no avail. Thanks
I had your problem, i fixed it with this getIcon method:
public Icon getIcon(int side, int meta) {
if (this.isActive) {
if (meta == 5 && side == 5)
return iconBuffer[1];
if (meta == 2 && side == 2)
return iconBuffer[1];
if (meta == 4 && side == 4)
return iconBuffer[1];
if (meta == 3 && side == 3)
return iconBuffer[1];
} else {
if (meta == 5 && side == 5)
return iconBuffer[0];
if (meta == 2 && side == 2)
return iconBuffer[0];
if (meta == 4 && side == 4)
return iconBuffer[0];
if (meta == 3 && side == 3)
return iconBuffer[0];
}
if (meta == 0 && side == 3)
return iconBuffer[0];
return iconBuffer[2];
}
The last if() is for the inventory rendering, in inventory the block does not have meta, so if meta is 0 and the side is 3, it will use the front texture.
my variables are:
0 = front disabled
1 = front enabled
2 = sides
I don't know that this is what you want, but there is how i fixed it.
I've got a couple of blocks I'm working on, in two seperate mods, and both are demonstrating the same thing; if, when I get the icons, I set them to a side in particular, the face shows in the inventory bar correctly.
However, if it gets decided via metadata (like the furnace, along with other tutorials I've found online), the face is missing completely from the inventory bar. I've tried all variations I can think of, to no avail.
Here's my code:
I don't want to hard-code the sides in, because I want it to be directional, like most other blocks. How can I set it to show the face of my block in my inventory, without giving up the metadata? I've googled all the terms I could think of, to no avail. Thanks
I had your problem, i fixed it with this getIcon method:
The last if() is for the inventory rendering, in inventory the block does not have meta, so if meta is 0 and the side is 3, it will use the front texture.
my variables are:
0 = front disabled
1 = front enabled
2 = sides
I don't know that this is what you want, but there is how i fixed it.
Check my Youtube Channel, RxDTheMinecrafter!