Java Code Examples for net.minecraft.client.renderer.RenderBlocks#setRenderBoundsFromBlock()
The following examples show how to use
net.minecraft.client.renderer.RenderBlocks#setRenderBoundsFromBlock() .
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: BlockExtendedNodeJarRenderer.java From Gadomancy with GNU Lesser General Public License v3.0 | 6 votes |
@Override public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { GL11.glPushMatrix(); GL11.glEnable(3042); GL11.glBlendFunc(770, 771); Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture); IIcon i1 = ((BlockJar) ConfigBlocks.blockJar).iconJarTop; IIcon i2 = ((BlockJar) ConfigBlocks.blockJar).iconJarSide; block.setBlockBounds(W3, 0.0F, W3, W13, W12, W13); renderer.setRenderBoundsFromBlock(block); drawFaces(renderer, block, ((BlockJar) ConfigBlocks.blockJar).iconJarBottom, i1, i2, i2, i2, i2, true); block.setBlockBounds(W5, W12, W5, W11, W14, W11); renderer.setRenderBoundsFromBlock(block); drawFaces(renderer, block, ((BlockJar) ConfigBlocks.blockJar).iconJarBottom, i1, i2, i2, i2, i2, true); GL11.glPopMatrix(); }
Example 2
Source File: BlockExtendedNodeJarRenderer.java From Gadomancy with GNU Lesser General Public License v3.0 | 6 votes |
@Override public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { int bb = setBrightness(world, x, y, z, block); int metadata = world.getBlockMetadata(x, y, z); block.setBlockBounds(W3, 0.0F, W3, W13, W12, W13); renderer.setRenderBoundsFromBlock(block); renderer.renderStandardBlock(block, x, y, z); block.setBlockBounds(W5, W12, W5, W11, W14, W11); renderer.setRenderBoundsFromBlock(block); renderer.renderStandardBlock(block, x, y, z); renderer.clearOverrideBlockTexture(); block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); renderer.setRenderBoundsFromBlock(block); return true; }
Example 3
Source File: ThinLogFenceRenderer.java From GardenCollection with MIT License | 6 votes |
public void renderInventoryBlock (BlockThinLogFence block, int metadata, int modelId, RenderBlocks renderer) { block.setBlockBoundsForItemRender(); GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); GL11.glTranslatef(-0.5F, -0.5F, -0.5F); Tessellator tessellator = Tessellator.instance; GL11.glTranslatef(-0.5f, 0, 0); renderer.setRenderBoundsFromBlock(block); renderPostAtOrigin(block, metadata, renderer, tessellator); renderSideAtOrigin(block, metadata, renderer, tessellator, .5f, 1); GL11.glTranslatef(1f, 0, 0); renderer.setRenderBoundsFromBlock(block); renderPostAtOrigin(block, metadata, renderer, tessellator); renderSideAtOrigin(block, metadata, renderer, tessellator, 0, .5f); GL11.glTranslatef(-.5f, 0, 0); GL11.glTranslatef(0.5F, 0.5F, 0.5F); }
Example 4
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 5
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 6
Source File: QCraftProxyClient.java From qcraft-mod with Apache License 2.0 | 5 votes |
@Override public boolean renderWorldBlock( IBlockAccess world, int i, int j, int k, Block block, int modelID, RenderBlocks renderblocks ) { if( modelID == QCraft.Blocks.quantumLogic.blockRenderID ) { int metadata = world.getBlockMetadata( i, j, k ); int direction = BlockDirectional.getDirection( metadata ); int subType = ( (BlockQuantumLogic) block ).getSubType( metadata ); // Draw Base switch( direction ) { case 0: renderblocks.uvRotateTop = 0; break; case 1: renderblocks.uvRotateTop = 1; break; case 2: renderblocks.uvRotateTop = 3; break; case 3: renderblocks.uvRotateTop = 2; break; } renderblocks.setRenderBoundsFromBlock( block ); renderblocks.renderStandardBlock( block, i, j, k ); renderblocks.uvRotateTop = 0; return true; } return false; }
Example 7
Source File: QCraftProxyClient.java From qcraft-mod with Apache License 2.0 | 5 votes |
@Override public boolean renderWorldBlock( IBlockAccess world, int i, int j, int k, Block block, int modelID, RenderBlocks renderblocks ) { if( modelID == getRenderId() && block == QCraft.Blocks.qBlock ) { QCraft.Blocks.qBlock.s_forceGrass = ( QCraft.Blocks.qBlock.getImpostorBlock( world, i, j, k ) == Blocks.grass ); QCraft.Blocks.qBlock.setBlockBounds( 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f ); renderblocks.setRenderBoundsFromBlock( QCraft.Blocks.qBlock ); renderblocks.renderStandardBlock( QCraft.Blocks.qBlock, i, j, k ); QCraft.Blocks.qBlock.s_forceGrass = false; return true; } return false; }
Example 8
Source File: TextureType.java From Chisel-2 with GNU General Public License v2.0 | 5 votes |
@Override public RenderBlocks createRenderContext(RenderBlocks rendererOld, Block block, IBlockAccess world) { initStatics(); RenderBlocks rb = type.createRenderContext(rendererOld, world, cachedObject); rb.setRenderBoundsFromBlock(block); return rb; }
Example 9
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 10
Source File: BlockPIMRenderer.java From OpenPeripheral-Addons with MIT License | 5 votes |
@Override public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, BlockPIM block, int modelId, RenderBlocks renderer) { renderer.setRenderBoundsFromBlock(block); renderer.renderStandardBlock(block, x, y, z); final boolean isBreaking = renderer.hasOverrideBlockTexture(); if (!isBreaking) renderer.setOverrideBlockTexture(BlockPIM.Icons.black); final boolean hasPlayer = hasPlayer(world, x, y, z); setTopPartBounds(renderer, hasPlayer); renderer.renderStandardBlock(block, x, y, z); if (!isBreaking) renderer.clearOverrideBlockTexture(); return true; }
Example 11
Source File: RotorSimpleRenderer.java From BigReactors with MIT License | 5 votes |
public static void renderBlade(RenderBlocks renderer, int x, int y, int z, Block block, int metadata, ForgeDirection rotorDir) { if(rotorDir == ForgeDirection.UNKNOWN) { rotorDir = ForgeDirection.UP; } double xMin, yMin, zMin, xMax, yMax, zMax; xMin = yMin = zMin = 0D; xMax = yMax = zMax = 1D; if(rotorDir.offsetX != 0) { xMin = 0.45D; xMax = 0.55D; } else if(rotorDir.offsetY != 0) { yMin = 0.45D; yMax = 0.55D; } else if(rotorDir.offsetZ != 0) { zMin = 0.45D; zMax = 0.55D; } Tessellator.instance.setColorRGBA(255, 255, 255, 255); renderer.setRenderBoundsFromBlock(block); renderer.setOverrideBlockTexture(null); renderer.setRenderBounds(xMin, yMin, zMin, xMax, yMax, zMax); renderer.renderFaceYNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, metadata)); renderer.setRenderBounds(xMin, yMin, zMin, xMax, yMax, zMax); renderer.renderFaceYPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 1, metadata)); renderer.setRenderBounds(xMin, yMin, zMin, xMax, yMax, zMax); renderer.renderFaceZNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 2, metadata)); renderer.setRenderBounds(xMin, yMin, zMin, xMax, yMax, zMax); renderer.renderFaceZPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 3, metadata)); renderer.setRenderBounds(xMin, yMin, zMin, xMax, yMax, zMax); renderer.renderFaceXNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 4, metadata)); renderer.setRenderBounds(xMin, yMin, zMin, xMax, yMax, zMax); renderer.renderFaceXPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 5, metadata)); renderer.setRenderBounds(0D, 0D, 0D, 1D, 1D, 1D); }
Example 12
Source File: RendererRoadLine.java From Chisel-2 with GNU General Public License v2.0 | 4 votes |
@Override public void renderInventoryBlock(Block block, int meta, int modelID, RenderBlocks renderer) { renderer.setRenderBoundsFromBlock(block); Drawing.drawBlock(block, meta, renderer); }
Example 13
Source File: ThinLogRenderer.java From GardenCollection with MIT License | 4 votes |
private boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, BlockThinLog block, int modelId, RenderBlocks renderer) { float margin = block.getMargin(); int connectFlags = block.calcConnectionFlags(world, x, y, z); boolean connectYNeg = (connectFlags & 1) != 0; boolean connectYPos = (connectFlags & 2) != 0; boolean connectZNeg = (connectFlags & 4) != 0; boolean connectZPos = (connectFlags & 8) != 0; boolean connectXNeg = (connectFlags & 16) != 0; boolean connectXPos = (connectFlags & 32) != 0; boolean connectY = connectYNeg | connectYPos; boolean connectZ = connectZNeg | connectZPos; boolean connectX = connectXNeg | connectXPos; if (!(connectYNeg && connectYPos) && !(connectZNeg && connectZPos) && !(connectXNeg && connectXPos)) { if (connectY && !connectX && !connectZ) block.setOrientation(0); else if (connectZ && !connectY && !connectX) block.setOrientation(1); else if (connectX && !connectY && !connectZ) block.setOrientation(2); else block.setOrientation(3); renderer.setRenderBounds(margin, margin, margin, 1 - margin, 1 - margin, 1 - margin); renderer.renderStandardBlock(block, x, y, z); } if (connectY) { block.setOrientation(0); if (connectYNeg && connectYPos) renderer.setRenderBounds(margin, 0, margin, 1 - margin, 1, 1 - margin); else if (connectYNeg) renderer.setRenderBounds(margin, 0, margin, 1 - margin, margin, 1 - margin); else if (connectYPos) renderer.setRenderBounds(margin, 1 - margin, margin, 1 - margin, 1, 1 - margin); renderer.renderStandardBlock(block, x, y, z); } if (connectZ) { block.setOrientation(1); if (connectZNeg && connectZPos) renderer.setRenderBounds(margin, margin, 0, 1 - margin, 1 - margin, 1); else if (connectZNeg) renderer.setRenderBounds(margin, margin, 0, 1 - margin, 1 - margin, margin); else if (connectZPos) renderer.setRenderBounds(margin, margin, 1 - margin, 1 - margin, 1 - margin, 1); renderer.renderStandardBlock(block, x, y, z); } if (connectX) { block.setOrientation(2); if (connectXNeg && connectXPos) renderer.setRenderBounds(0, margin, margin, 1, 1 - margin, 1 - margin); else if (connectXNeg) renderer.setRenderBounds(0, margin, margin, margin, 1 - margin, 1 - margin); else if (connectXPos) renderer.setRenderBounds(1 - margin, margin, margin, 1, 1 - margin, 1 - margin); renderer.renderStandardBlock(block, x, y, z); } block.setOrientation(0); //renderer.renderStandardBlock(block, x, y, z); Block blockUnder = world.getBlock(x, y - 1, z); if (blockUnder instanceof BlockGarden) { float yDiff = ((BlockGarden) blockUnder).getSlotProfile().getPlantOffsetY(world, x, y, z, 0); if (yDiff >= (1 - .0625f) * 2) { //Tessellator tessellator = Tessellator.instance; //tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); //tessellator.setColorOpaque_F(1f, 1f, 1f); // block.setBlockBounds(margin, -.0625f, margin, 1 - margin, 0, 1 - margin); renderer.setRenderBounds(margin, yDiff, margin, 1 - margin, 1, 1 - margin); renderer.renderStandardBlock(block, x, y - 1, z); //IIcon sideIcon = block.getIcon(2, world.getBlockMetadata(x, y, z)); //renderer.renderFaceXNeg(block, x, y - 1, z, sideIcon); //renderer.renderFaceXPos(block, x, y - 1, z, sideIcon); //renderer.renderFaceZNeg(block, x, y - 1, z, sideIcon); //renderer.renderFaceZPos(block, x, y - 1, z, sideIcon); // block.setBlockBoundsForItemRender(); renderer.setRenderBoundsFromBlock(block); } } return true; }
Example 14
Source File: BlockRoadLineRenderer.java From Chisel with GNU General Public License v2.0 | 4 votes |
@Override public void renderInventoryBlock(Block block, int meta, int modelID, RenderBlocks renderer) { renderer.setRenderBoundsFromBlock(block); Drawing.drawBlock(block, meta, renderer); }
Example 15
Source File: RotorSimpleRenderer.java From BigReactors with MIT License | 4 votes |
public static void renderRotorShaft(Block block, RenderBlocks renderer, int metadata, ForgeDirection majorAxis, boolean[] hasBlades, int x, int y, int z, boolean drawOuterRectangle) { double xMin, yMin, zMin; double xMax, yMax, zMax; xMin = yMin = zMin = 0.5D - rotorSize; xMax = yMax = zMax = 0.5D + rotorSize; if(majorAxis.offsetX != 0) { xMax = 1D; xMin = 0D; } if(majorAxis.offsetY != 0) { yMax = 1D; yMin = 0D; } if(majorAxis.offsetZ != 0) { zMax = 1D; zMin = 0D; } Tessellator.instance.setColorRGBA(255, 255, 255, 255); renderer.setRenderBoundsFromBlock(block); renderer.setOverrideBlockTexture(null); renderer.setRenderBounds(xMin, yMin, zMin, xMax, yMax, zMax); renderer.renderFaceYNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, metadata)); renderer.setRenderBounds(xMin, yMin, zMin, xMax, yMax, zMax); renderer.renderFaceYPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 1, metadata)); renderer.setRenderBounds(xMin, yMin, zMin, xMax, yMax, zMax); renderer.renderFaceZNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 2, metadata)); renderer.setRenderBounds(xMin, yMin, zMin, xMax, yMax, zMax); renderer.renderFaceZPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 3, metadata)); renderer.setRenderBounds(xMin, yMin, zMin, xMax, yMax, zMax); renderer.renderFaceXNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 4, metadata)); renderer.setRenderBounds(xMin, yMin, zMin, xMax, yMax, zMax); renderer.renderFaceXPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 5, metadata)); renderer.setRenderBounds(0D, 0D, 0D, 1D, 1D, 1D); // Render blade surfaces, if present ForgeDirection[] bladeDirs = StaticUtils.neighborsBySide[majorAxis.ordinal()]; for(int i = 0; i < bladeDirs.length; i++) { if(hasBlades[i]) { renderRotorBladeConnection(renderer, block, metadata, majorAxis, bladeDirs[i], x, y, z, drawOuterRectangle); } } renderer.setRenderBounds(0D, 0D, 0D, 1D, 1D, 1D); }