Java Code Examples for net.minecraft.client.renderer.RenderBlocks#renderFaceYPos()
The following examples show how to use
net.minecraft.client.renderer.RenderBlocks#renderFaceYPos() .
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: GroundCoverPlantRenderer.java From GardenCollection with MIT License | 6 votes |
@Override public void render (IBlockAccess world, int x, int y, int z, RenderBlocks renderer, Block block, int meta, int height, AxisAlignedBB[] bounds) { IPlantMetaResolver resolver = PlantRegistry.instance().getPlantMetaResolver(block, meta); if (resolver != null) meta = resolver.getPlantSectionMeta(block, meta, height); IIcon icon = renderer.getBlockIconFromSideAndMetadata(block, 0, meta); renderer.setRenderBounds(0, 0, 0, 1, .03125, 1); renderer.renderFaceYPos(block, x, y, z, icon); /*float f = 0.1F; double d0 = (double)icon.getMinU(); double d1 = (double)icon.getMinV(); double d2 = (double)icon.getMaxU(); double d3 = (double)icon.getMaxV(); float f1 = (float)x + 0.5F; float f2 = (float)z + 0.5F; float f3 = (float)(i1 & 1) * 0.5F * (float)(1 - i1 / 2 % 2 * 2); float f4 = (float)(i1 + 1 & 1) * 0.5F * (float)(1 - (i1 + 1) / 2 % 2 * 2);*/ }
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: 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 4
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 5
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 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: ThinLogFenceRenderer.java From GardenCollection with MIT License | 5 votes |
private void renderPostAtOrigin (BlockThinLogFence block, int metadata, RenderBlocks renderer, Tessellator tessellator) { 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)); renderer.renderFaceZNeg(block, 0, 0, .5f, block.getSideIcon()); 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)); renderer.renderFaceZPos(block, 0, 0, -.5f, block.getSideIcon()); 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)); renderer.renderFaceXNeg(block, .5f, 0, 0, block.getSideIcon()); 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)); renderer.renderFaceXPos(block, -.5f, 0, 0, block.getSideIcon()); tessellator.draw(); }
Example 10
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 11
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 12
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 13
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 14
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 15
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 16
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 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: 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 19
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 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); }