Eternaldoom Posted September 6, 2014 Posted September 6, 2014 I have an ISBRH for a custom crop. In eclipse, it looks fine and renders the way it should, but outside eclipse, the block goes back and forth between rendering as a normal block and rendering the way it should. Heres how its supposed to look: And heres how it often looks: Heres the rendering class: public class RenderSoyPlant implements ISimpleBlockRenderingHandler{ public static int renderId; private Tessellator t = Tessellator.instance; public RenderSoyPlant(){ renderId = RenderingRegistry.getNextAvailableRenderId(); } @Override public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {} @Override public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { IIcon icon = block.getIcon(0, world.getBlockMetadata(x, y, z)); double u = icon.getMinU(); double v = icon.getMinV(); double U = icon.getMaxU(); double V = icon.getMaxV(); t.addTranslation(x, y, z); int lightValue = block.getMixedBrightnessForBlock(world, (int)x, (int)y, (int)z); t.setBrightness(lightValue); t.setColorOpaque_F(1.0F, 1.0F, 1.0F); renderer.renderStandardBlockWithAmbientOcclusion(block, (int)x, (int)y, (int)z, lightValue, lightValue, lightValue); renderModel(u, v, U, V); t.addTranslation(-x, -y, -z); return true; } private void renderModel(double u, double v, double U, double V){ t.addVertexWithUV(0.5, 1, 1, u, v); t.addVertexWithUV(0.5, 1, 0, U, v); t.addVertexWithUV(0.5, 0, 0, U, V); t.addVertexWithUV(0.5, 0, 1, u, V); t.addVertexWithUV(0.5, 1, 0, U, v); t.addVertexWithUV(0.5, 1, 1, u, v); t.addVertexWithUV(0.5, 0, 1, u, V); t.addVertexWithUV(0.5, 0, 0, U, V); t.addVertexWithUV(1, 1, 0.5, u, v); t.addVertexWithUV(0, 1, 0.5, U, v); t.addVertexWithUV(0, 0, 0.5, U, V); t.addVertexWithUV(1, 0, 0.5, u, V); t.addVertexWithUV(0, 1, 0.5, U, v); t.addVertexWithUV(1, 1, 0.5, u, v); t.addVertexWithUV(1, 0, 0.5, u, V); t.addVertexWithUV(0, 0, 0.5, U, V); t.addVertexWithUV(0.825, 1, 0.825, u, v); t.addVertexWithUV(0.125, 1, 0.125, U, v); t.addVertexWithUV(0.125, 0, 0.125, U, V); t.addVertexWithUV(0.825, 0, 0.825, u, V); t.addVertexWithUV(0.125, 1, 0.125, U, v); t.addVertexWithUV(0.825, 1, 0.825, u, v); t.addVertexWithUV(0.825, 0, 0.825, u, V); t.addVertexWithUV(0.125, 0, 0.125, U, V); t.addVertexWithUV(0.825, 1, 0.125, u, v); t.addVertexWithUV(0.125, 1, 0.825, U, v); t.addVertexWithUV(0.125, 0, 0.825, U, V); t.addVertexWithUV(0.825, 0, 0.125, u, V); t.addVertexWithUV(0.125, 1, 0.825, U, v); t.addVertexWithUV(0.825, 1, 0.125, u, v); t.addVertexWithUV(0.825, 0, 0.125, u, V); t.addVertexWithUV(0.125, 0, 0.825, U, V); } @Override public boolean shouldRender3DInInventory(int modelId) { return false; } @Override public int getRenderId() { return renderId; } } Quote Check out my mod, Realms of Chaos, here. If I helped you, be sure to press the "Thank You" button!
TheGreyGhost Posted September 6, 2014 Posted September 6, 2014 Hi That's quite odd. It looks to me like it's trying to render as a standard cut-down block using your texture for all six sides. What is this line in there for? renderer.renderStandardBlockWithAmbientOcclusion(block, (int)x, (int)y, (int)z, lightValue, lightValue, lightValue); First thing I would I suggest you try: add System.out.println("renderWorldBlock()") to your method and see if is still getting called when the rendering goes strange. -TGG Quote
Eternaldoom Posted September 6, 2014 Author Posted September 6, 2014 It wasn't getting called, but it turns out it was an optifine problem, so sorry for wasting your time. Quote Check out my mod, Realms of Chaos, here. If I helped you, be sure to press the "Thank You" button!
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.