Java Code Examples for net.minecraft.client.renderer.RenderBlocks#renderFaceYNeg()
The following examples show how to use
net.minecraft.client.renderer.RenderBlocks#renderFaceYNeg() .
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: RenderHelper.java From ExtraCells1 with MIT License | 6 votes |
public void drawFace(ForgeDirection side, Block block, double x, double y, double z, Icon icon, RenderBlocks renderer) { switch (side) { case UP: renderer.renderFaceYPos(block, x, y, z, icon); break; case DOWN: renderer.renderFaceYNeg(block, x, y, z, icon); break; case NORTH: renderer.renderFaceZNeg(block, x, y, z, icon); break; case EAST: renderer.renderFaceXPos(block, x, y, z, icon); break; case SOUTH: renderer.renderFaceZPos(block, x, y, z, icon); break; case WEST: renderer.renderFaceXNeg(block, x, y, z, icon); break; case UNKNOWN: break; } }
Example 2
Source File: BlockChorusFlowerRender.java From Et-Futurum with The Unlicense | 6 votes |
private void renderCube(RenderBlocks renderer, Block block, int meta) { 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, meta)); tessellator.setNormal(0.0F, 1.0F, 0.0F); renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 1, meta)); tessellator.setNormal(0.0F, 0.0F, -1.0F); renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 2, meta)); tessellator.setNormal(0.0F, 0.0F, 1.0F); renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 3, meta)); tessellator.setNormal(-1.0F, 0.0F, 0.0F); renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 4, meta)); tessellator.setNormal(1.0F, 0.0F, 0.0F); renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 5, meta)); tessellator.draw(); }
Example 3
Source File: ModelCertusTank.java From ExtraCells1 with MIT License | 5 votes |
public void renderOuterBlock(Block block, int x, int y, int z, RenderBlocks renderer, IBlockAccess world) { Tessellator tessellator = Tessellator.instance; boolean tankUp = world.getBlockTileEntity(x, y + 1, z) instanceof TileEntityCertusTank; boolean tankDown = world.getBlockTileEntity(x, y - 1, z) instanceof TileEntityCertusTank; int meta = 0; if (tankUp && tankDown) meta = 3; else if (tankUp) meta = 2; else if (tankDown) meta = 1; if (!tankDown) { tessellator.setNormal(0.0F, -1F, 0.0F); renderer.renderFaceYNeg(block, x, y, z, block.getIcon(0, 0)); } if (!(tankUp)) { tessellator.setNormal(0.0F, 1.0F, 0.0F); renderer.renderFaceYPos(block, x, y, z, block.getIcon(1, 0)); } Icon sideIcon = block.getIcon(3, meta); tessellator.setNormal(0.0F, 0.0F, -1F); renderer.renderFaceZNeg(block, x, y, z, sideIcon); tessellator.setNormal(0.0F, 0.0F, 1.0F); renderer.renderFaceZPos(block, x, y, z, sideIcon); tessellator.setNormal(-1F, 0.0F, 0.0F); renderer.renderFaceXNeg(block, x, y, z, sideIcon); tessellator.setNormal(1.0F, 0.0F, 0.0F); renderer.renderFaceXPos(block, x, y, z, sideIcon); }
Example 4
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 5
Source File: SimpleRendererFuelRod.java From BigReactors with MIT License | 5 votes |
@Override public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { Tessellator tessellator = Tessellator.instance; 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 6
Source File: Drawing.java From Chisel with GNU General Public License v2.0 | 5 votes |
public static void drawBlock(Block block, IIcon icon, RenderBlocks renderer) { Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, -1.0F, 0.0F); renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, icon); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 1.0F, 0.0F); renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, icon); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, -1.0F); renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, icon); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, 1.0F); renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, icon); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(-1.0F, 0.0F, 0.0F); renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, icon); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(1.0F, 0.0F, 0.0F); renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, icon); tessellator.draw(); }
Example 7
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 8
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 9
Source File: ModelCertusTank.java From ExtraCells1 with MIT License | 5 votes |
public void renderFluid(TileEntity tileEntity, double x, double y, double z, RenderBlocks renderer) { Tessellator tessellator = Tessellator.instance; tessellator.setColorOpaque(255, 255, 255); if (tileEntity != null && ((TileEntityCertusTank) tileEntity).getTankInfo(ForgeDirection.UNKNOWN)[0].fluid != null) { Fluid storedFluid = ((TileEntityCertusTank) tileEntity).getRenderFluid(); float scale = ((TileEntityCertusTank) tileEntity).getRenderScale(); if (storedFluid != null && scale > 0) { GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); Block id = Block.blocksList[FluidRegistry.WATER.getBlockID()]; Icon fluidIcon = storedFluid.getIcon(); if (fluidIcon == null) fluidIcon = FluidRegistry.LAVA.getIcon(); renderer.setRenderBounds(0.08F, 0.001F, 0.08F, 0.92, scale * 0.999F, 0.92F); tessellator.setNormal(0.0F, -1F, 0.0F); renderer.renderFaceYNeg(id, x, y, z, fluidIcon); tessellator.setNormal(0.0F, 1.0F, 0.0F); renderer.renderFaceYPos(id, x, y, z, fluidIcon); tessellator.setNormal(0.0F, 0.0F, -1F); renderer.renderFaceZNeg(id, x, y, z, fluidIcon); tessellator.setNormal(0.0F, 0.0F, 1.0F); renderer.renderFaceZPos(id, x, y, z, fluidIcon); tessellator.setNormal(-1F, 0.0F, 0.0F); renderer.renderFaceXNeg(id, x, y, z, fluidIcon); tessellator.setNormal(1.0F, 0.0F, 0.0F); renderer.renderFaceXPos(id, x, y, z, fluidIcon); } } }
Example 10
Source File: QCraftProxyClient.java From qcraft-mod with Apache License 2.0 | 5 votes |
private void renderInventoryQBlock( RenderBlocks renderblocks, BlockQBlock block, int type, BlockQBlock.Appearance appearance ) { Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); bindColor( block.getColorForType( 0, type ) ); tessellator.setNormal( 0.0F, -1F, 0.0F ); renderblocks.renderFaceYNeg( block, 0.0D, 0.0D, 0.0D, block.getIconForType( 0, type, appearance ) ); tessellator.draw(); tessellator.startDrawingQuads(); bindColor( block.getColorForType( 1, type ) ); tessellator.setNormal( 0.0F, 1.0F, 0.0F ); renderblocks.renderFaceYPos( block, 0.0D, 0.0D, 0.0D, block.getIconForType( 1, type, appearance ) ); tessellator.draw(); tessellator.startDrawingQuads(); bindColor( block.getColorForType( 2, type ) ); tessellator.setNormal( 0.0F, 0.0F, -1F ); renderblocks.renderFaceZNeg( block, 0.0D, 0.0D, 0.0D, block.getIconForType( 2, type, appearance ) ); tessellator.draw(); tessellator.startDrawingQuads(); bindColor( block.getColorForType( 3, type ) ); tessellator.setNormal( 0.0F, 0.0F, 1.0F ); renderblocks.renderFaceZPos( block, 0.0D, 0.0D, 0.0D, block.getIconForType( 3, type, appearance ) ); tessellator.draw(); tessellator.startDrawingQuads(); bindColor( block.getColorForType( 4, type ) ); tessellator.setNormal( -1F, 0.0F, 0.0F ); renderblocks.renderFaceXNeg( block, 0.0D, 0.0D, 0.0D, block.getIconForType( 4, type, appearance ) ); tessellator.draw(); tessellator.startDrawingQuads(); bindColor( block.getColorForType( 5, type ) ); tessellator.setNormal( 1.0F, 0.0F, 0.0F ); renderblocks.renderFaceXPos( block, 0.0D, 0.0D, 0.0D, block.getIconForType( 5, type, appearance ) ); tessellator.draw(); }
Example 11
Source File: BlockRenderingHandler.java From Gadomancy with GNU Lesser General Public License v3.0 | 5 votes |
protected void renderFace(int side, RenderBlocks renderer, Block block, int x, int y, int z, IIcon icon) { switch (side) { case 0: renderer.renderFaceYNeg(block, x, y, z, icon); break; case 1: renderer.renderFaceYPos(block, x, y, z, icon); break; case 2: renderer.renderFaceZNeg(block, x, y, z, icon); break; case 3: renderer.renderFaceZPos(block, x, y, z, icon); break; case 4: renderer.renderFaceXNeg(block, x, y, z, icon); break; case 5: renderer.renderFaceXPos(block, x, y, z, icon); break; } }
Example 12
Source File: BlockRenderingHandler.java From Gadomancy with GNU Lesser General Public License v3.0 | 5 votes |
protected void renderAllFaces(RenderBlocks renderer, Block block, int x, int y, int z, IIcon icon) { renderer.renderFaceYNeg(block, x, y, z, icon); renderer.renderFaceYPos(block, x, y, z, icon); renderer.renderFaceZNeg(block, x, y, z, icon); renderer.renderFaceZPos(block, x, y, z, icon); renderer.renderFaceXNeg(block, x, y, z, icon); renderer.renderFaceXPos(block, x, y, z, icon); }
Example 13
Source File: BlockExtendedNodeJarRenderer.java From Gadomancy with GNU Lesser General Public License v3.0 | 5 votes |
public static void drawFaces(RenderBlocks renderblocks, Block block, IIcon i1, IIcon i2, IIcon i3, IIcon i4, IIcon i5, IIcon i6, boolean solidtop) { Tessellator tessellator = Tessellator.instance; GL11.glTranslatef(-0.5F, -0.5F, -0.5F); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, -1.0F, 0.0F); renderblocks.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, i1); tessellator.draw(); if (solidtop) { GL11.glDisable(3008); } tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 1.0F, 0.0F); renderblocks.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, i2); tessellator.draw(); if (solidtop) { GL11.glEnable(3008); } tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, 1.0F); renderblocks.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, i3); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, -1.0F); renderblocks.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, i4); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(1.0F, 0.0F, 0.0F); renderblocks.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, i5); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(-1.0F, 0.0F, 0.0F); renderblocks.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, i6); tessellator.draw(); GL11.glTranslatef(0.5F, 0.5F, 0.5F); }
Example 14
Source File: TileEntityEndRodRenderer.java From Et-Futurum with The Unlicense | 4 votes |
public static void renderRod(RenderBlocks renderer, Block block, int meta) { Tessellator tessellator = Tessellator.instance; double x = 7 / 16.0; double y = 0; double z = 7 / 16.0; renderer.setRenderBounds(0, 1 / 16F, 0, 2 / 16F, 1, 2 / 16F); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, -1.0F, 0.0F); renderer.renderFaceYNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta)); tessellator.setNormal(0.0F, 1.0F, 0.0F); renderer.renderFaceYPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 1, meta)); tessellator.setNormal(0.0F, 0.0F, -1.0F); renderer.renderFaceZNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 2, meta)); tessellator.setNormal(0.0F, 0.0F, 1.0F); renderer.renderFaceZPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 3, meta)); tessellator.setNormal(-1.0F, 0.0F, 0.0F); renderer.renderFaceXNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 4, meta)); tessellator.setNormal(1.0F, 0.0F, 0.0F); renderer.renderFaceXPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 5, meta)); tessellator.draw(); x = 4 / 16.0; y = 0; z = 4 / 16.0; renderer.setRenderBounds(2 / 16F, 0, 2 / 16F, 6 / 16F, 1 / 16F, 6 / 16F); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, -1.0F, 0.0F); renderer.renderFaceYNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta)); tessellator.setNormal(0.0F, 1.0F, 0.0F); renderer.renderFaceYPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 1, meta)); y = -13 / 16.0; renderer.setRenderBounds(2 / 16F, 13 / 16F, 2 / 16F, 6 / 16F, 14 / 16F, 6 / 16F); tessellator.setNormal(0.0F, 0.0F, -1.0F); renderer.renderFaceZNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 2, meta)); tessellator.setNormal(0.0F, 0.0F, 1.0F); renderer.renderFaceZPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 3, meta)); tessellator.setNormal(-1.0F, 0.0F, 0.0F); renderer.renderFaceXNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 4, meta)); tessellator.setNormal(1.0F, 0.0F, 0.0F); renderer.renderFaceXPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 5, meta)); tessellator.draw(); }
Example 15
Source File: BlockDoorRenderer.java From Et-Futurum with The Unlicense | 4 votes |
@Override public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { Tessellator tessellator = Tessellator.instance; int meta = world.getBlockMetadata(x, y, z); if ((meta & 8) != 0) { if (world.getBlock(x, y - 1, z) != block) return false; } else if (world.getBlock(x, y + 1, z) != block) return false; int brightness = block.getMixedBrightnessForBlock(world, x, y, z); tessellator.setBrightness(renderer.renderMinY > 0.0D ? brightness : block.getMixedBrightnessForBlock(world, x, y - 1, z)); tessellator.setColorOpaque_F(0.5F, 0.5F, 0.5F); renderer.renderFaceYNeg(block, x, y, z, renderer.getBlockIcon(block, world, x, y, z, 0)); if ((meta & 8) != 0) { tessellator.setBrightness(renderer.renderMaxY < 1.0D ? brightness : block.getMixedBrightnessForBlock(world, x, y + 1, z)); tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F); renderer.uvRotateTop = 2; renderer.renderFaceYPos(block, x, y, z, renderer.getBlockIcon(block, world, x, y, z, 1)); renderer.uvRotateTop = 0; } tessellator.setBrightness(renderer.renderMinZ > 0.0D ? brightness : block.getMixedBrightnessForBlock(world, x, y, z - 1)); tessellator.setColorOpaque_F(0.8F, 0.8F, 0.8F); renderer.renderFaceZNeg(block, x, y, z, renderer.getBlockIcon(block, world, x, y, z, 2)); renderer.flipTexture = false; tessellator.setBrightness(renderer.renderMaxZ < 1.0D ? brightness : block.getMixedBrightnessForBlock(world, x, y, z + 1)); tessellator.setColorOpaque_F(0.8F, 0.8F, 0.8F); renderer.renderFaceZPos(block, x, y, z, renderer.getBlockIcon(block, world, x, y, z, 3)); renderer.flipTexture = false; tessellator.setBrightness(renderer.renderMinX > 0.0D ? brightness : block.getMixedBrightnessForBlock(world, x - 1, y, z)); tessellator.setColorOpaque_F(0.6F, 0.6F, 0.6F); renderer.renderFaceXNeg(block, x, y, z, renderer.getBlockIcon(block, world, x, y, z, 4)); renderer.flipTexture = false; tessellator.setBrightness(renderer.renderMaxX < 1.0D ? brightness : block.getMixedBrightnessForBlock(world, x + 1, y, z)); tessellator.setColorOpaque_F(0.6F, 0.6F, 0.6F); renderer.renderFaceXPos(block, x, y, z, renderer.getBlockIcon(block, world, x, y, z, 5)); renderer.flipTexture = false; return true; }
Example 16
Source File: RenderBlockSeat.java From archimedes-ships with MIT License | 4 votes |
@Override public void renderInventoryBlock(Block block, int meta, int modelID, RenderBlocks renderer) { Tessellator tess = Tessellator.instance; GL11.glTranslatef(-0.5F, -0.5F, -0.5F); tess.startDrawingQuads(); tess.setNormal(0.0F, -1.0F, 0.0F); renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSide(block, 0)); tess.setNormal(0.0F, 1.0F, 0.0F); renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSide(block, 1)); tess.setNormal(0.0F, 0.0F, -1.0F); renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSide(block, 5)); tess.setNormal(0.0F, 0.0F, 1.0F); renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSide(block, 2)); tess.setNormal(-1.0F, 0.0F, 0.0F); renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSide(block, 3)); tess.setNormal(1.0F, 0.0F, 0.0F); renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSide(block, 4)); tess.draw(); renderer.setRenderBounds(0F, block.getBlockBoundsMaxY(), 0F, 1F, 1F, 0.2F); tess.startDrawingQuads(); tess.setNormal(0.0F, -1.0F, 0.0F); renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSide(block, 0)); tess.setNormal(0.0F, 1.0F, 0.0F); renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSide(block, 1)); tess.setNormal(0.0F, 0.0F, -1.0F); renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSide(block, 5)); tess.setNormal(0.0F, 0.0F, 1.0F); renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSide(block, 2)); tess.setNormal(-1.0F, 0.0F, 0.0F); renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSide(block, 3)); tess.setNormal(1.0F, 0.0F, 0.0F); renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSide(block, 4)); tess.draw(); GL11.glTranslatef(0.5F, 0.5F, 0.5F); /* renderer.renderAllFaces = true; renderer.setRenderBounds(0D, 0D, 0D, 1D, 0.5D, 1D); renderer.renderStandardBlock(block, 0, 0, 0); if (meta == 0) { renderer.setRenderBounds(0D, 0D, 0D, 0.2D, 1D, 1D); } else if (meta == 1) { } else if (meta == 2) { renderer.setRenderBounds(0.8D, 0D, 0D, 1D, 1D, 1D); } else if (meta == 3) { } //renderer.renderStandardBlock(block, x, y, z); renderer.renderAllFaces = false; */ }
Example 17
Source File: ItemRendererCertusTank.java From ExtraCells1 with MIT License | 4 votes |
public void renderItem(ItemRenderType type, ItemStack item, Object... data) { Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("extracells", "textures/blocks/texmap_tank.png")); GL11.glPushMatrix(); GL11.glTranslatef(0.5F, 0.5F, 0.5F); GL11.glScalef(1.0F, -1F, -1F); model.render(0.0625f); GL11.glScalef(1.0F, -1F, 1.0F); model.render(0.0625f); if (item != null && item.hasTagCompound()) { FluidStack storedFluid = FluidStack.loadFluidStackFromNBT(item.getTagCompound().getCompoundTag("tileEntity")); int tankCapacity = 32000; if (storedFluid != null && storedFluid.getFluid() != null) { Icon fluidIcon = storedFluid.getFluid().getIcon(); Tessellator tessellator = Tessellator.instance; RenderBlocks renderer = new RenderBlocks(); GL11.glScalef(1.0F, 1.0F, -1.0F); renderer.setRenderBounds(0.08F, 0.001F, 0.08F, 0.92, (float) storedFluid.amount / (float) tankCapacity * 0.999F, 0.92F); Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture); GL11.glTranslatef(-0.5F, -0.5F, -0.5F); GL11.glPushAttrib(GL11.GL_ENABLE_BIT); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glDisable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, -1F, 0.0F); renderer.renderFaceYNeg(Block.blocksList[FluidRegistry.WATER.getBlockID()], 0.0D, 0.0D, 0.0D, fluidIcon); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 1.0F, 0.0F); renderer.renderFaceYPos(Block.blocksList[FluidRegistry.WATER.getBlockID()], 0.0D, 0.0D, 0.0D, fluidIcon); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, -1F); renderer.renderFaceZNeg(Block.blocksList[FluidRegistry.WATER.getBlockID()], 0.0D, 0.0D, 0.0D, fluidIcon); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, 1.0F); renderer.renderFaceZPos(Block.blocksList[FluidRegistry.WATER.getBlockID()], 0.0D, 0.0D, 0.0D, fluidIcon); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(-1F, 0.0F, 0.0F); renderer.renderFaceXNeg(Block.blocksList[FluidRegistry.WATER.getBlockID()], 0.0D, 0.0D, 0.0D, fluidIcon); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(1.0F, 0.0F, 0.0F); renderer.renderFaceXPos(Block.blocksList[FluidRegistry.WATER.getBlockID()], 0.0D, 0.0D, 0.0D, fluidIcon); tessellator.draw(); GL11.glPopAttrib(); } } GL11.glPopMatrix(); }
Example 18
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); }
Example 19
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 20
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); }