Java Code Examples for net.minecraft.client.renderer.RenderBlocks#renderFaceZNeg()
The following examples show how to use
net.minecraft.client.renderer.RenderBlocks#renderFaceZNeg() .
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: FlowerLeafRenderer.java From GardenCollection with MIT License | 5 votes |
private boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, BlockFlowerLeaves block, int modelId, RenderBlocks renderer) { renderer.renderStandardBlock(block, x, y, z); Tessellator tessellator = Tessellator.instance; tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); tessellator.setColorOpaque_F(1f, 1f, 1f); int meta = world.getBlockMetadata(x, y, z); float offset = .03125f; IIcon icon = block.getFlowerIcon(world, x, y, z, meta, 1); if (icon != null) renderer.renderFaceYPos(block, x, y + offset, z, icon); icon = block.getFlowerIcon(world, x, y, z, meta, 2); if (icon != null) renderer.renderFaceZNeg(block, x, y, z - offset, icon); icon = block.getFlowerIcon(world, x, y, z, meta, 3); if (icon != null) renderer.renderFaceZPos(block, x, y, z + offset, icon); icon = block.getFlowerIcon(world, x, y, z, meta, 4); if (icon != null) renderer.renderFaceXNeg(block, x - offset, y, z, icon); icon = block.getFlowerIcon(world, x, y, z, meta, 5); if (icon != null) renderer.renderFaceXPos(block, x + offset, y, z, icon); return true; }
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: RenderLaserSource.java From Artifacts with MIT License | 5 votes |
@Override public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { int l = 1; if(world != null) l = world.getBlockMetadata(x, y, z); IIcon laser = block.getIcon(0,0); Tessellator tessellator = Tessellator.instance; tessellator.setBrightness(15728880); tessellator.setColorOpaque_F(1, 1, 1); float f = 1F - 1F/128F; renderer.renderMaxX = 1; renderer.renderMinX = 0; renderer.renderMaxY = 1; renderer.renderMinY = 0; renderer.renderMaxZ = 1; renderer.renderMinZ = 0; switch(l&3) { case 0: renderer.renderFaceZPos(Blocks.ice, x, y, z-f, laser); break; case 1: renderer.renderFaceXNeg(Blocks.ice, x+f, y, z, laser); break; case 2: renderer.renderFaceZNeg(Blocks.ice, x, y, z+f, laser); break; case 3: renderer.renderFaceXPos(Blocks.ice, x-f, y, z, laser); break; } if(world != null) renderer.renderBlockAllFaces(BlockLaserBeam.instance, x, y, z); return true; }
Example 6
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 7
Source File: Drawing.java From Chisel with GNU General Public License v2.0 | 5 votes |
public static void drawBlock(Block block, int meta, 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, block.getIcon(0, meta)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 1.0F, 0.0F); renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(1, meta)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, -1.0F); renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(2, meta)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, 1.0F); renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(3, meta)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(-1.0F, 0.0F, 0.0F); renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(4, meta)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(1.0F, 0.0F, 0.0F); renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(5, meta)); tessellator.draw(); }
Example 8
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 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: 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 11
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 12
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 13
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 14
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 15
Source File: ModelCertusTank.java From ExtraCells1 with MIT License | 5 votes |
public void renderInnerBlock(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 + 0.001D, z, block.getIcon(0, 0)); } if (!(tankUp)) { tessellator.setNormal(0.0F, 1.0F, 0.0F); renderer.renderFaceYPos(block, x, y - 0.001D, z, block.getIcon(1, 0)); } Icon sideIcon = block.getIcon(3, meta); tessellator.setNormal(0.0F, 0.0F, -1F); renderer.renderFaceZNeg(block, x, y, z + 0.001D, sideIcon); tessellator.setNormal(0.0F, 0.0F, 1.0F); renderer.renderFaceZPos(block, x, y, z - 0.001D, sideIcon); tessellator.setNormal(-1F, 0.0F, 0.0F); renderer.renderFaceXNeg(block, x + 0.001D, y, z, sideIcon); tessellator.setNormal(1.0F, 0.0F, 0.0F); renderer.renderFaceXPos(block, x - 0.001D, y, z, sideIcon); }
Example 16
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 17
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 18
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); }
Example 19
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 20
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); }