Aha, good. I thought I derped hard on this. Well, not a problem. Can you recommend some tutorials for TESR and ISBR? For this case, I'll need something for non tile entities, as only the controller block will be one. So I guess I need ISBR then..?
Ok, I got it to the point where I managed to have a custom renderer for my Block. (Found the "Diamond in ice" tutorial).
But now I have a problem, the Block does render in both pass 0 and 1, but the Texture that is rendered in pass 1, is always the one that is visible.
My idea was, to draw the background texture in pass 0, and the Texture with transparent pixels on top of that, in pass 1.
But the texture from pass 0 is overwritten with the one from pass 1; The transparent areas show the grass below it, it's completely replaced.
This is my (messy..) function to render the Block:
CoreBlock tBlock = (CoreBlock)block;
FMLLog.log(Level.INFO, "RenderPass: %d start", tProxy.renderPass);
if(tProxy.renderPass == 0)
{
IIcon tBackL = tBlock.getNormalIcon();
float u = tBackL.getMinU();
float v = tBackL.getMinV();
float U = tBackL.getMaxU();
float V = tBackL.getMaxV();
Tessellator tes = Tessellator.instance;
tes.addTranslation(x, y, z);
tes.addVertexWithUV(0, 1, 1, u, v);
tes.addVertexWithUV(1, 1, 1, u, V);
tes.addVertexWithUV(1, 1, 0, U, V);
tes.addVertexWithUV(0, 1, 0, U, v);
tes.addTranslation(-x, -y, -z);
FMLLog.log(Level.INFO, "RenderPass 0 done");
}
else
{
IIcon tTopL = tBlock.getAlpaIcon();
float u = tTopL.getMinU();
float v = tTopL.getMinV();
float U = tTopL.getMaxU();
float V = tTopL.getMaxV();
Tessellator tes = Tessellator.instance;
tes.addTranslation(x, y, z);
tes.addVertexWithUV(0, 1, 1, u, v);
tes.addVertexWithUV(1, 1, 1, u, V);
tes.addVertexWithUV(1, 1, 0, U, V);
tes.addVertexWithUV(0, 1, 0, U, v);
tes.addTranslation(-x, -y, -z);
FMLLog.log(Level.INFO, "RenderPass 1 done");
}
This is the actual result:
Also, I wonder if that will work with an animated texture. (The one i've tried is not).
The renderer is only called when I place/break something around it, I assume it needs to redraw the texture to
"animate" the background layer?