Hi everyone, I've recently started getting into Minecraft modding. I've followed a couple of tutorials on the wiki and Youtube, and I think I have a basic understanding of how Forge works (hooks and whatnot).
What I'm trying to do now is to render a custom block (really simple, just a table made of five boxes), and I've read on the wiki that the correct way to do this is by implementing ISimpleBlockRenderingHandler in a custom renderer. The problem is, I haven't found any documentation on how to do it, and even trying by myself didn't give positive results.
This is briefly what I have right now:
mod_Minesona.java
MinesonaClientProxy.java
BlockVelvetTable.java
RendererVelvetTable.java
ModelVelvetTable.java
(There's more, obviously, like gui handler, tile entity and so on, but I don't think they are quite useful in this case.)
The model class has been automatically generated by Techne, I've only removed some parts to make it simpler, but it didn't work even before doing that.
Using this code, I get this error when trying to place the block:
2012-11-14 13:06:53 [iNFO] [sTDERR] java.lang.IllegalStateException: Already tesselating!
2012-11-14 13:06:53 [iNFO] [sTDERR] at net.minecraft.src.Tessellator.startDrawing(Tessellator.java:343)
2012-11-14 13:06:53 [iNFO] [sTDERR] at net.minecraft.src.Tessellator.startDrawingQuads(Tessellator.java:333)
2012-11-14 13:06:53 [iNFO] [sTDERR] at net.minecraft.src.TexturedQuad.draw(TexturedQuad.java:48)
2012-11-14 13:06:53 [iNFO] [sTDERR] at net.minecraft.src.ModelBox.render(ModelBox.java:102)
2012-11-14 13:06:53 [iNFO] [sTDERR] at net.minecraft.src.ModelRenderer.compileDisplayList(ModelRenderer.java:298)
2012-11-14 13:06:53 [iNFO] [sTDERR] at net.minecraft.src.ModelRenderer.render(ModelRenderer.java:131)
2012-11-14 13:06:53 [iNFO] [sTDERR] at narrakan.minesona.client.ModelVelvetTable.render(ModelVelvetTable.java:48)
2012-11-14 13:06:53 [iNFO] [sTDERR] at narrakan.minesona.client.RendererVelvetTable.renderWorldBlock(RendererVelvetTable.java:33)
2012-11-14 13:06:53 [iNFO] [sTDERR] at cpw.mods.fml.client.registry.RenderingRegistry.renderWorldBlock(RenderingRegistry.java:145)
2012-11-14 13:06:53 [iNFO] [sTDERR] at net.minecraft.src.FMLRenderAccessLibrary.renderWorldBlock(FMLRenderAccessLibrary.java:78)
2012-11-14 13:06:53 [iNFO] [sTDERR] at net.minecraft.src.RenderBlocks.renderBlockByRenderType(RenderBlocks.java:510)
2012-11-14 13:06:53 [iNFO] [sTDERR] at net.minecraft.src.WorldRenderer.updateRenderer(WorldRenderer.java:218)
2012-11-14 13:06:53 [iNFO] [sTDERR] at net.minecraft.src.RenderGlobal.updateRenderers(RenderGlobal.java:1457)
2012-11-14 13:06:53 [iNFO] [sTDERR] at net.minecraft.src.EntityRenderer.renderWorld(EntityRenderer.java:1075)
2012-11-14 13:06:53 [iNFO] [sTDERR] at net.minecraft.src.EntityRenderer.updateCameraAndRender(EntityRenderer.java:947)
2012-11-14 13:06:53 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:888)
2012-11-14 13:06:53 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.run(Minecraft.java:783)
2012-11-14 13:06:53 [iNFO] [sTDERR] at java.lang.Thread.run(Unknown Source)
But if I remove the line
modelVelvetTable.render(0.025F);
from renderWorldBlock in my renderer, everything works fine (the block is obviously transparent), and if I change it to
renderer.renderStandardBlock(mod_Minesona.velvetTable, x, y, z);
it works just fine, rendering a simple block.
Am I missing something?
PS: I am more than willing to update the wiki with any information provided in this thread, if it helps solving the problem.