Closed TheJulianJES closed 9 years ago
Hmm it's interesting. I haven't got any overlay rendering for blocks in PneumaticCraft. However, it's pretty similar to how item overlays are done. Simply return a different icon for a different render pass in the Block#getIcon. The same can be done for Block#colorMultiplier. The only problem with this is that the render pass isn't accessible in these methods. A solution for this is:
private static int renderPass;
public boolean canRenderInPass(int pass){
renderPass = pass;
return true;
}
With this you also have enabled the block to be rendered in two passes. Let me know if that helped you, else I might look at doing a tut on it.
Okay, it work's, I had to add:
@Override
public int getRenderBlockPass() {
return 1;
}
But it's not rendering in the inventory :C
Okay, I did an IItemRenderer and now it's work's! Thank you!
Ah, yeah, that makes sense. If you look at the 'call hierarchy' of the canRenderInPass() you'll see it's only called in the block in world rendering.
As a solution I would have recommended to use IItemRenderer, which is exactly what you did, so good job :)
This is a suggestion, maybe do a tutorial on overlay rendering. I know this for items, but not for blocks. If this is in PneumaticCraft, can you please send me a link to where is it. Thank's! Also sorry for my bad English, I'm German :)