@Override public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { if (block.getRenderType() == BuildCraftCore.blockByEntityModel) { EntityRenderIndex index = new EntityRenderIndex(block, metadata); if (blockByEntityRenders.containsKey(index)) { blockByEntityRenders.get(index).inventoryRender(-0.5, -0.5, -0.5, 0, 0); } } else if (block.getRenderType() == BuildCraftCore.legacyPipeModel) { Tessellator tessellator = Tessellator.instance; block.setBlockBounds( Utils.pipeMinPos, 0.0F, Utils.pipeMinPos, Utils.pipeMaxPos, 1.0F, Utils.pipeMaxPos); renderer.func_83018_a(block); block.setBlockBoundsForItemRender(); GL11.glTranslatef(-0.5F, -0.5F, -0.5F); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, -1F, 0.0F); renderer.renderBottomFace( block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(0, metadata)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 1.0F, 0.0F); renderer.renderTopFace( block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(1, metadata)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, -1F); renderer.renderEastFace( block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(2, metadata)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, 1.0F); renderer.renderWestFace( block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(3, metadata)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(-1F, 0.0F, 0.0F); renderer.renderNorthFace( block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(4, metadata)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(1.0F, 0.0F, 0.0F); renderer.renderSouthFace( block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(5, metadata)); tessellator.draw(); GL11.glTranslatef(0.5F, 0.5F, 0.5F); block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); } }
private void renderBlockInInv(RenderBlocks renderblocks, Block block, int i) { Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, -1F, 0.0F); renderblocks.renderBottomFace( block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(0, i)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 1.0F, 0.0F); renderblocks.renderTopFace( block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(1, i)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, -1F); renderblocks.renderEastFace( block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(2, i)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, 1.0F); renderblocks.renderWestFace( block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(3, i)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(-1F, 0.0F, 0.0F); renderblocks.renderNorthFace( block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(4, i)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(1.0F, 0.0F, 0.0F); renderblocks.renderSouthFace( block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(5, i)); tessellator.draw(); }