Java Code Examples for net.minecraft.block.Block#setBlockBoundsForItemRender()
The following examples show how to use
net.minecraft.block.Block#setBlockBoundsForItemRender() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RendererGlasBlock.java From bartworks with MIT License | 5 votes |
@Override public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { Tessellator tessellator = Tessellator.instance; block.setBlockBoundsForItemRender(); renderer.setRenderBoundsFromBlock(block); GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); GL11.glTranslatef(-0.5F, -0.5F, -0.5F); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, -1.0F, 0.0F); renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 0, metadata)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 1.0F, 0.0F); renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 1, metadata)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, -1.0F); renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 2, metadata)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, 1.0F); renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 3, metadata)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(-1.0F, 0.0F, 0.0F); renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 4, metadata)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(1.0F, 0.0F, 0.0F); renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 5, metadata)); tessellator.draw(); GL11.glTranslatef(0.5F, 0.5F, 0.5F); }
Example 2
Source File: BW_Renderer_Block_Ores.java From bartworks with MIT License | 5 votes |
@Override public void renderInventoryBlock(Block aBlock, int aMeta, int modelId, RenderBlocks aRenderer) { BW_MetaGenerated_Block_TE tTileEntity = ((BW_MetaGenerated_Blocks)aBlock).getProperTileEntityForRendering(); tTileEntity.mMetaData = (short) aMeta; aBlock.setBlockBoundsForItemRender(); aRenderer.setRenderBoundsFromBlock(aBlock); GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); GL11.glTranslatef(-0.5F, -0.5F, -0.5F); Tessellator.instance.startDrawingQuads(); Tessellator.instance.setNormal(0.0F, -1.0F, 0.0F); renderNegativeYFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 0), true); Tessellator.instance.draw(); Tessellator.instance.startDrawingQuads(); Tessellator.instance.setNormal(0.0F, 1.0F, 0.0F); renderPositiveYFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 1), true); Tessellator.instance.draw(); Tessellator.instance.startDrawingQuads(); Tessellator.instance.setNormal(0.0F, 0.0F, -1.0F); renderNegativeZFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 2), true); Tessellator.instance.draw(); Tessellator.instance.startDrawingQuads(); Tessellator.instance.setNormal(0.0F, 0.0F, 1.0F); renderPositiveZFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 3), true); Tessellator.instance.draw(); Tessellator.instance.startDrawingQuads(); Tessellator.instance.setNormal(-1.0F, 0.0F, 0.0F); renderNegativeXFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 4), true); Tessellator.instance.draw(); Tessellator.instance.startDrawingQuads(); Tessellator.instance.setNormal(1.0F, 0.0F, 0.0F); renderPositiveXFacing(null, aRenderer, aBlock, 0, 0, 0, tTileEntity.getTexture(aBlock, (byte) 5), true); Tessellator.instance.draw(); aBlock.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); aRenderer.setRenderBoundsFromBlock(aBlock); GL11.glTranslatef(0.5F, 0.5F, 0.5F); }
Example 3
Source File: ThinLogRenderer.java From GardenCollection with MIT License | 5 votes |
@Override public void renderInventoryBlock (Block block, int metadata, int modelId, RenderBlocks renderer) { block.setBlockBoundsForItemRender(); renderer.setRenderBoundsFromBlock(block); GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); GL11.glTranslatef(-0.5F, -0.5F, -0.5F); Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, -1.0F, 0.0F); renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 0, metadata)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 1.0F, 0.0F); renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 1, metadata)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, -1.0F); renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 2, metadata)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, 1.0F); renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 3, metadata)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(-1.0F, 0.0F, 0.0F); renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 4, metadata)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(1.0F, 0.0F, 0.0F); renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 5, metadata)); tessellator.draw(); GL11.glTranslatef(0.5F, 0.5F, 0.5F); }
Example 4
Source File: RenderHelperMonitorStorageFluid.java From ExtraCells1 with MIT License | 4 votes |
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { Tessellator tessellator = Tessellator.instance; block.setBlockBoundsForItemRender(); GL11.glTranslatef(-0.5F, -0.5F, -0.5F); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, -1.0F, 0.0F); renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, metadata)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 1.0F, 0.0F); renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(1, metadata)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, -1.0F); tessellator.addTranslation(0.0F, 0.0F, 0.0F); renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(2, metadata)); tessellator.addTranslation(0.0F, 0.0F, 0.0F); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, 1.0F); tessellator.addTranslation(0.0F, 0.0F, 0.0F); renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(3, metadata)); tessellator.addTranslation(0.0F, 0.0F, 0.0F); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(-1.0F, 0.0F, 0.0F); tessellator.addTranslation(0.0F, 0.0F, 0.0F); tessellator.setBrightness(15 << 20 | 15 << 6); tessellator.setColorRGBA_I(0xFFFFFF, 0xFF); int[] color = { 0x1B2344, 0x895CA8, 0xDABDEF }; BlockMonitorStorageFluid terminal = (BlockMonitorStorageFluid) block; renderer.renderFaceXNeg(block, 0, 0, 0, terminal.baseLayer); for (int i = 0; i < 3; i++) { tessellator.setColorRGBA_I(color[i], 0xFF); renderer.renderFaceXNeg(block, 0, 0, 0, terminal.colorLayers[i]); } tessellator.addTranslation(0.0F, 0.0F, 0.0F); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(1.0F, 0.0F, 0.0F); tessellator.addTranslation(0.0F, 0.0F, 0.0F); renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(5, metadata)); tessellator.addTranslation(0.0F, 0.0F, 0.0F); tessellator.draw(); GL11.glTranslatef(0.5F, 0.5F, 0.5F); }
Example 5
Source File: RenderHelperTerminalFluid.java From ExtraCells1 with MIT License | 4 votes |
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { Tessellator tessellator = Tessellator.instance; block.setBlockBoundsForItemRender(); GL11.glTranslatef(-0.5F, -0.5F, -0.5F); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, -1.0F, 0.0F); renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, metadata)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 1.0F, 0.0F); renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(1, metadata)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, -1.0F); tessellator.addTranslation(0.0F, 0.0F, 0.0F); renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(2, metadata)); tessellator.addTranslation(0.0F, 0.0F, 0.0F); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, 1.0F); tessellator.addTranslation(0.0F, 0.0F, 0.0F); renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(3, metadata)); tessellator.addTranslation(0.0F, 0.0F, 0.0F); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(-1.0F, 0.0F, 0.0F); tessellator.addTranslation(0.0F, 0.0F, 0.0F); tessellator.setBrightness(15 << 20 | 15 << 6); tessellator.setColorRGBA_I(0xFFFFFF, 0xFF); int[] color = { 0x1B2344, 0x895CA8, 0xDABDEF }; BlockTerminalFluid terminal = (BlockTerminalFluid) block; renderer.renderFaceXNeg(block, 0, 0, 0, terminal.baseLayer); for (int i = 0; i < 3; i++) { tessellator.setColorRGBA_I(color[i], 0xFF); renderer.renderFaceXNeg(block, 0, 0, 0, terminal.colorLayers[i]); } tessellator.addTranslation(0.0F, 0.0F, 0.0F); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(1.0F, 0.0F, 0.0F); tessellator.addTranslation(0.0F, 0.0F, 0.0F); renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(5, metadata)); tessellator.addTranslation(0.0F, 0.0F, 0.0F); tessellator.draw(); GL11.glTranslatef(0.5F, 0.5F, 0.5F); }