Java Code Examples for net.minecraft.client.renderer.RenderBlocks#renderFaceZPos()
The following examples show how to use
net.minecraft.client.renderer.RenderBlocks#renderFaceZPos() .
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: 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 2
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 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: 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 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, 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 7
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 8
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 9
Source File: ThinLogFenceRenderer.java From GardenCollection with MIT License | 5 votes |
private void renderSideAtOrigin (BlockThinLogFence block, int metadata, RenderBlocks renderer, Tessellator tessellator, float xs, float xe) { tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, -1.0F); renderer.setRenderBounds(xs, 0, 0, xe, 1, 1); renderer.renderFaceZNeg(block, 0, 0, .5f, block.getSideIcon()); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, 1.0F); renderer.setRenderBounds(xs, 0, 0, xe, 1, 1); renderer.renderFaceZPos(block, 0, 0, -.5f, block.getSideIcon()); tessellator.draw(); }
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: 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 12
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 13
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 14
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 15
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 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: ThinLogFenceRenderer.java From GardenCollection with MIT License | 4 votes |
private boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, BlockThinLogFence block, int modelId, RenderBlocks renderer) { float margin = block.getMargin(); renderer.setRenderBounds(margin, 0, margin, 1 - margin, 1, 1 - margin); renderer.renderStandardBlock(block, x, y, z); IIcon sideIcon = block.getSideIcon(); boolean connectedZNeg = block.canConnectFenceTo(world, x, y, z - 1); boolean connectedZPos = block.canConnectFenceTo(world, x, y, z + 1); boolean connectedXNeg = block.canConnectFenceTo(world, x - 1, y, z); boolean connectedXPos = block.canConnectFenceTo(world, x + 1, y, z); if (connectedXNeg || connectedXPos) { if (connectedXNeg && connectedXPos) renderer.setRenderBounds(0, 0, .5, 1, 1, .5); else if (connectedXNeg) renderer.setRenderBounds(0, 0, .5, .5, 1, .5); else if (connectedXPos) renderer.setRenderBounds(.5, 0, .5, 1, 1, .5); renderer.flipTexture = true; renderer.renderFaceZNeg(block, x, y, z, sideIcon); renderer.flipTexture = false; renderer.renderFaceZPos(block, x, y, z, sideIcon); } if (connectedZNeg || connectedZPos) { if (connectedZNeg && connectedZPos) renderer.setRenderBounds(.5, 0, 0, .5, 1, 1); else if (connectedZNeg) renderer.setRenderBounds(.5, 0, 0, .5, 1, .5f); else if (connectedZPos) renderer.setRenderBounds(.5, 0, .5f, .5, 1, 1); renderer.flipTexture = true; renderer.renderFaceXPos(block, x, y, z, sideIcon); renderer.flipTexture = false; renderer.renderFaceXNeg(block, x, y, z, sideIcon); } return true; }
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: BlockSlimeBlockRender.java From Et-Futurum with The Unlicense | 4 votes |
@Override public void renderInventoryBlock(Block block, int meta, int modelID, RenderBlocks renderer) { Tessellator tessellator = Tessellator.instance; OpenGLHelper.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); OpenGLHelper.enableBlend(); OpenGLHelper.translate(-0.5F, -0.5F, -0.5F); float f = 0.0625F; renderer.setRenderBounds(f * 3, f * 3, f * 3, f * 13, f * 13, f * 13); 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(); renderer.setRenderBounds(0, 0, 0, 1, 1, 1); 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(); OpenGLHelper.translate(0.5F, 0.5F, 0.5F); OpenGLHelper.disableBlend(); }