Skip to content

Instantly share code, notes, and snippets.

@mDiyo
Created February 18, 2013 08:51
Show Gist options
  • Save mDiyo/4976001 to your computer and use it in GitHub Desktop.
Save mDiyo/4976001 to your computer and use it in GitHub Desktop.
Inventory Block Render
private void renderStandardInvBlock(RenderBlocks renderblocks, Block block, int meta)
{
Tessellator tessellator = Tessellator.instance;
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, -1F, 0.0F);
renderblocks.renderBottomFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(0, meta));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 1.0F, 0.0F);
renderblocks.renderTopFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(1, meta));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, -1F);
renderblocks.renderEastFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(2, meta));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, 1.0F);
renderblocks.renderWestFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(3, meta));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(-1F, 0.0F, 0.0F);
renderblocks.renderNorthFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(4, meta));
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(1.0F, 0.0F, 0.0F);
renderblocks.renderSouthFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(5, meta));
tessellator.draw();
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment