// Renders the look of the fence in Inventory public void RenderInvBlock(RenderBlocks renderblocks, Block block, int i, int j) { Tessellator tessellator = Tessellator.instance; // (0.0F, wallBottom, wallOffset, 1.0F, wallHeight, wallWidth); block.setBlockBounds(0.0F, 0.0F, 0.3F, 1.0F, 0.8F, 0.7F); GL11.glTranslatef(-0.5F, -0.5F, -0.5F); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, -1F, 0.0F); renderblocks.renderBottomFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(0)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 1.0F, 0.0F); renderblocks.renderTopFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(1)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, -1F); renderblocks.renderEastFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(2)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, 1.0F); renderblocks.renderWestFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(3)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(-1F, 0.0F, 0.0F); renderblocks.renderNorthFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(4)); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(1.0F, 0.0F, 0.0F); renderblocks.renderSouthFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(5)); tessellator.draw(); GL11.glTranslatef(0.5F, 0.5F, 0.5F); block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); }
private void RenderMissileInInv(RenderBlocks renderer, Block block, int metadata) { Tessellator tesselator = Tessellator.instance; int sideTex = 0; int topTex = 0; for (int i = 0; i < 6; i++) { // Get bounds for each rectangle if (i == 0) block.setBlockBounds(0.4F, 0.95F, 0.4F, 0.6F, 1.0F, 0.6F); else if (i == 1) block.setBlockBounds(0.3F, 0.0F, 0.3F, 0.7F, 0.95F, 0.7F); else if (i == 2) block.setBlockBounds(0.4F, 0F, 0.1F, 0.6F, 0.4F, 0.3F); else if (i == 3) block.setBlockBounds(0.4F, 0F, 0.7F, 0.6F, 0.4F, 0.9F); else if (i == 4) block.setBlockBounds(0.1F, 0F, 0.4F, 0.3F, 0.4F, 0.6F); else if (i == 5) block.setBlockBounds(0.7F, 0F, 0.4F, 0.9F, 0.4F, 0.6F); // Get textures if (i == 0 && metadata != 0 && metadata != 15) { topTex = 15; sideTex = block.getBlockTextureFromSideAndMetadata(1, metadata); } else if (i == 0) { topTex = 18; sideTex = block.getBlockTextureFromSideAndMetadata(1, metadata); } else if (i == 1 && metadata != 0 && metadata != 15) { sideTex = block.getBlockTextureFromSideAndMetadata(1, 1); topTex = block.getBlockTextureFromSideAndMetadata(1, 1); } else if (i == 1) { sideTex = block.getBlockTextureFromSideAndMetadata(1, metadata); topTex = block.getBlockTextureFromSideAndMetadata(1, metadata); } else if (metadata != 0 && metadata != 15) { sideTex = topTex = 15; } else { sideTex = topTex = 18; } GL11.glTranslatef(-0.5F, -0.5F, -0.5F); tesselator.startDrawingQuads(); tesselator.setNormal(0.0F, -1.0F, 0.0F); renderer.renderBottomFace(block, 0.0D, 0.0D, 0.0D, sideTex); tesselator.draw(); tesselator.startDrawingQuads(); tesselator.setNormal(0.0F, 1.0F, 0.0F); renderer.renderTopFace(block, 0.0D, 0.0D, 0.0D, topTex); tesselator.draw(); tesselator.startDrawingQuads(); tesselator.setNormal(0.0F, 0.0F, -1.0F); renderer.renderEastFace(block, 0.0D, 0.0D, 0.0D, sideTex); tesselator.draw(); tesselator.startDrawingQuads(); tesselator.setNormal(0.0F, 0.0F, 1.0F); renderer.renderWestFace(block, 0.0D, 0.0D, 0.0D, sideTex); tesselator.draw(); tesselator.startDrawingQuads(); tesselator.setNormal(-1.0F, 0.0F, 0.0F); renderer.renderNorthFace(block, 0.0D, 0.0D, 0.0D, sideTex); tesselator.draw(); tesselator.startDrawingQuads(); tesselator.setNormal(1.0F, 0.0F, 0.0F); renderer.renderSouthFace(block, 0.0D, 0.0D, 0.0D, sideTex); tesselator.draw(); GL11.glTranslatef(0.5F, 0.5F, 0.5F); } block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); }
public void renderParticle( Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { int i = (int) ((((float) field_35130_a + par2) * 15F) / (float) field_35129_ay); if (i > 15) { return; } else { field_35128_az.bindTexture(field_35128_az.getTexture("/misc/explosion.png")); float f = (float) (i % 4) / 4F; float f1 = f + 0.24975F; float f2 = (float) (i / 4) / 4F; float f3 = f2 + 0.24975F; float f4 = 2.0F * field_35131_aA; float f5 = (float) ((prevPosX + (posX - prevPosX) * (double) par2) - interpPosX); float f6 = (float) ((prevPosY + (posY - prevPosY) * (double) par2) - interpPosY); float f7 = (float) ((prevPosZ + (posZ - prevPosZ) * (double) par2) - interpPosZ); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glDisable(GL11.GL_LIGHTING); RenderHelper.disableStandardItemLighting(); par1Tessellator.startDrawingQuads(); par1Tessellator.setColorRGBA_F(rand.nextFloat(), rand.nextFloat(), rand.nextFloat(), 1.0F); par1Tessellator.setNormal(0.0F, 1.0F, 0.0F); par1Tessellator.setBrightness(240); par1Tessellator.addVertexWithUV( f5 - par3 * f4 - par6 * f4, f6 - par4 * f4, f7 - par5 * f4 - par7 * f4, f1, f3); par1Tessellator.addVertexWithUV( (f5 - par3 * f4) + par6 * f4, f6 + par4 * f4, (f7 - par5 * f4) + par7 * f4, f1, f2); par1Tessellator.addVertexWithUV( f5 + par3 * f4 + par6 * f4, f6 + par4 * f4, f7 + par5 * f4 + par7 * f4, f, f2); par1Tessellator.addVertexWithUV( (f5 + par3 * f4) - par6 * f4, f6 - par4 * f4, (f7 + par5 * f4) - par7 * f4, f, f3); par1Tessellator.draw(); GL11.glPolygonOffset(0.0F, 0.0F); GL11.glEnable(GL11.GL_LIGHTING); return; } }
private void RenderMachineInInv(RenderBlocks renderer, Block block, int metadata) { Tessellator tesselator = Tessellator.instance; block.setBlockBounds(0, 0, 0, 1, 1, 1); GL11.glTranslatef(-0.5F, -0.5F, -0.5F); tesselator.startDrawingQuads(); tesselator.setNormal(0.0F, -1.0F, 0.0F); renderer.renderBottomFace( block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(0, metadata)); tesselator.draw(); tesselator.startDrawingQuads(); tesselator.setNormal(0.0F, 1.0F, 0.0F); renderer.renderTopFace( block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(1, metadata)); tesselator.draw(); tesselator.startDrawingQuads(); tesselator.setNormal(0.0F, 0.0F, -1.0F); renderer.renderEastFace( block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(2, metadata)); tesselator.draw(); tesselator.startDrawingQuads(); tesselator.setNormal(0.0F, 0.0F, 1.0F); renderer.renderWestFace( block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(3, metadata)); tesselator.draw(); tesselator.startDrawingQuads(); tesselator.setNormal(-1.0F, 0.0F, 0.0F); renderer.renderNorthFace( block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(4, metadata)); tesselator.draw(); tesselator.startDrawingQuads(); tesselator.setNormal(1.0F, 0.0F, 0.0F); renderer.renderSouthFace( block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(5, metadata)); tesselator.draw(); GL11.glTranslatef(0.5F, 0.5F, 0.5F); }
public void doRenderFishHook( EntityFishHook entityfishhook, double d, double d1, double d2, float f, float f1) { GL11.glPushMatrix(); GL11.glTranslatef((float) d, (float) d1, (float) d2); GL11.glEnable(32826 /*GL_RESCALE_NORMAL_EXT*/); GL11.glScalef(0.5F, 0.5F, 0.5F); int i = 1; byte byte0 = 2; loadTexture("/particles.png"); Tessellator tessellator = Tessellator.instance; float f2 = (float) (i * 8 + 0) / 128F; float f3 = (float) (i * 8 + 8) / 128F; float f4 = (float) (byte0 * 8 + 0) / 128F; float f5 = (float) (byte0 * 8 + 8) / 128F; float f6 = 1.0F; float f7 = 0.5F; float f8 = 0.5F; GL11.glRotatef(180F - renderManager.playerViewY, 0.0F, 1.0F, 0.0F); GL11.glRotatef(-renderManager.playerViewX, 1.0F, 0.0F, 0.0F); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 1.0F, 0.0F); tessellator.addVertexWithUV(0.0F - f7, 0.0F - f8, 0.0D, f2, f5); tessellator.addVertexWithUV(f6 - f7, 0.0F - f8, 0.0D, f3, f5); tessellator.addVertexWithUV(f6 - f7, 1.0F - f8, 0.0D, f3, f4); tessellator.addVertexWithUV(0.0F - f7, 1.0F - f8, 0.0D, f2, f4); tessellator.draw(); GL11.glDisable(32826 /*GL_RESCALE_NORMAL_EXT*/); GL11.glPopMatrix(); if (entityfishhook.angler != null) { float f9 = ((entityfishhook.angler.prevRotationYaw + (entityfishhook.angler.rotationYaw - entityfishhook.angler.prevRotationYaw) * f1) * 3.141593F) / 180F; double d3 = MathHelper.sin(f9); double d5 = MathHelper.cos(f9); float f11 = entityfishhook.angler.getSwingProgress(f1); float f12 = MathHelper.sin(MathHelper.sqrt_float(f11) * 3.141593F); Vec3D vec3d = Vec3D.createVector(-0.5D, 0.029999999999999999D, 0.80000000000000004D); vec3d.rotateAroundX( (-(entityfishhook.angler.prevRotationPitch + (entityfishhook.angler.rotationPitch - entityfishhook.angler.prevRotationPitch) * f1) * 3.141593F) / 180F); vec3d.rotateAroundY( (-(entityfishhook.angler.prevRotationYaw + (entityfishhook.angler.rotationYaw - entityfishhook.angler.prevRotationYaw) * f1) * 3.141593F) / 180F); vec3d.rotateAroundY(f12 * 0.5F); vec3d.rotateAroundX(-f12 * 0.7F); double d7 = entityfishhook.angler.prevPosX + (entityfishhook.angler.posX - entityfishhook.angler.prevPosX) * (double) f1 + vec3d.xCoord; double d8 = entityfishhook.angler.prevPosY + (entityfishhook.angler.posY - entityfishhook.angler.prevPosY) * (double) f1 + vec3d.yCoord; double d9 = entityfishhook.angler.prevPosZ + (entityfishhook.angler.posZ - entityfishhook.angler.prevPosZ) * (double) f1 + vec3d.zCoord; if (renderManager.options.thirdPersonView > 0) { float f10 = ((entityfishhook.angler.prevRenderYawOffset + (entityfishhook.angler.renderYawOffset - entityfishhook.angler.prevRenderYawOffset) * f1) * 3.141593F) / 180F; double d4 = MathHelper.sin(f10); double d6 = MathHelper.cos(f10); d7 = (entityfishhook.angler.prevPosX + (entityfishhook.angler.posX - entityfishhook.angler.prevPosX) * (double) f1) - d6 * 0.34999999999999998D - d4 * 0.84999999999999998D; d8 = (entityfishhook.angler.prevPosY + (entityfishhook.angler.posY - entityfishhook.angler.prevPosY) * (double) f1) - 0.45000000000000001D; d9 = ((entityfishhook.angler.prevPosZ + (entityfishhook.angler.posZ - entityfishhook.angler.prevPosZ) * (double) f1) - d4 * 0.34999999999999998D) + d6 * 0.84999999999999998D; } double d10 = entityfishhook.prevPosX + (entityfishhook.posX - entityfishhook.prevPosX) * (double) f1; double d11 = entityfishhook.prevPosY + (entityfishhook.posY - entityfishhook.prevPosY) * (double) f1 + 0.25D; double d12 = entityfishhook.prevPosZ + (entityfishhook.posZ - entityfishhook.prevPosZ) * (double) f1; double d13 = (float) (d7 - d10); double d14 = (float) (d8 - d11); double d15 = (float) (d9 - d12); GL11.glDisable(3553 /*GL_TEXTURE_2D*/); GL11.glDisable(2896 /*GL_LIGHTING*/); tessellator.startDrawing(3); tessellator.setColorOpaque_I(0); int j = 16; for (int k = 0; k <= j; k++) { float f13 = (float) k / (float) j; tessellator.addVertex( d + d13 * (double) f13, d1 + d14 * (double) (f13 * f13 + f13) * 0.5D + 0.25D, d2 + d15 * (double) f13); } tessellator.draw(); GL11.glEnable(2896 /*GL_LIGHTING*/); GL11.glEnable(3553 /*GL_TEXTURE_2D*/); } }
private void renderItemIn2D( Tessellator par1Tessellator, float par2, float par3, float par4, float par5) { float var6 = 1.0F; float var7 = 0.0625F; par1Tessellator.startDrawingQuads(); par1Tessellator.setNormal(0.0F, 0.0F, 1.0F); par1Tessellator.addVertexWithUV(0.0D, 0.0D, 0.0D, (double) par2, (double) par5); par1Tessellator.addVertexWithUV((double) var6, 0.0D, 0.0D, (double) par4, (double) par5); par1Tessellator.addVertexWithUV((double) var6, 1.0D, 0.0D, (double) par4, (double) par3); par1Tessellator.addVertexWithUV(0.0D, 1.0D, 0.0D, (double) par2, (double) par3); par1Tessellator.draw(); par1Tessellator.startDrawingQuads(); par1Tessellator.setNormal(0.0F, 0.0F, -1.0F); par1Tessellator.addVertexWithUV( 0.0D, 1.0D, (double) (0.0F - var7), (double) par2, (double) par3); par1Tessellator.addVertexWithUV( (double) var6, 1.0D, (double) (0.0F - var7), (double) par4, (double) par3); par1Tessellator.addVertexWithUV( (double) var6, 0.0D, (double) (0.0F - var7), (double) par4, (double) par5); par1Tessellator.addVertexWithUV( 0.0D, 0.0D, (double) (0.0F - var7), (double) par2, (double) par5); par1Tessellator.draw(); par1Tessellator.startDrawingQuads(); par1Tessellator.setNormal(-1.0F, 0.0F, 0.0F); int var8; float var9; float var10; float var11; // Spout HD Start for (var8 = 0; var8 < TileSize.int_size; ++var8) { var9 = (float) var8 / TileSize.float_size; var10 = par2 + (par4 - par2) * var9 - TileSize.float_texNudge; // Spout HD End var11 = var6 * var9; par1Tessellator.addVertexWithUV( (double) var11, 0.0D, (double) (0.0F - var7), (double) var10, (double) par5); par1Tessellator.addVertexWithUV((double) var11, 0.0D, 0.0D, (double) var10, (double) par5); par1Tessellator.addVertexWithUV((double) var11, 1.0D, 0.0D, (double) var10, (double) par3); par1Tessellator.addVertexWithUV( (double) var11, 1.0D, (double) (0.0F - var7), (double) var10, (double) par3); } par1Tessellator.draw(); par1Tessellator.startDrawingQuads(); par1Tessellator.setNormal(1.0F, 0.0F, 0.0F); // Spout HD Start for (var8 = 0; var8 < TileSize.int_size; ++var8) { var9 = (float) var8 / TileSize.float_size; var10 = par2 + (par4 - par2) * var9 - TileSize.float_texNudge; var11 = var6 * var9 + TileSize.float_reciprocal; // Spout HD End par1Tessellator.addVertexWithUV( (double) var11, 1.0D, (double) (0.0F - var7), (double) var10, (double) par3); par1Tessellator.addVertexWithUV((double) var11, 1.0D, 0.0D, (double) var10, (double) par3); par1Tessellator.addVertexWithUV((double) var11, 0.0D, 0.0D, (double) var10, (double) par5); par1Tessellator.addVertexWithUV( (double) var11, 0.0D, (double) (0.0F - var7), (double) var10, (double) par5); } par1Tessellator.draw(); par1Tessellator.startDrawingQuads(); par1Tessellator.setNormal(0.0F, 1.0F, 0.0F); // Spout HD Start for (var8 = 0; var8 < TileSize.int_size; ++var8) { var9 = (float) var8 / TileSize.float_size; var10 = par5 + (par3 - par5) * var9 - TileSize.float_texNudge; var11 = var6 * var9 + TileSize.float_reciprocal; // Spout HD End par1Tessellator.addVertexWithUV(0.0D, (double) var11, 0.0D, (double) par2, (double) var10); par1Tessellator.addVertexWithUV( (double) var6, (double) var11, 0.0D, (double) par4, (double) var10); par1Tessellator.addVertexWithUV( (double) var6, (double) var11, (double) (0.0F - var7), (double) par4, (double) var10); par1Tessellator.addVertexWithUV( 0.0D, (double) var11, (double) (0.0F - var7), (double) par2, (double) var10); } par1Tessellator.draw(); par1Tessellator.startDrawingQuads(); par1Tessellator.setNormal(0.0F, -1.0F, 0.0F); // Spout HD Start for (var8 = 0; var8 < TileSize.int_size; ++var8) { var9 = (float) var8 / TileSize.float_size; var10 = par5 + (par3 - par5) * var9 - TileSize.float_texNudge; // Spout HD End var11 = var6 * var9; par1Tessellator.addVertexWithUV( (double) var6, (double) var11, 0.0D, (double) par4, (double) var10); par1Tessellator.addVertexWithUV(0.0D, (double) var11, 0.0D, (double) par2, (double) var10); par1Tessellator.addVertexWithUV( 0.0D, (double) var11, (double) (0.0F - var7), (double) par2, (double) var10); par1Tessellator.addVertexWithUV( (double) var6, (double) var11, (double) (0.0F - var7), (double) par4, (double) var10); } par1Tessellator.draw(); }
private void func_159_a(EntityWallpaper_Kaevator entitywallpaper) { GL11.glScalef(16.0F / 256.0F, 16.0F / 256.0F, 1.0F / 16.0F); float f = -8.0F; float f1 = -8.0F; Tessellator tessellator = Tessellator.instance; float f2 = 0.0F; float f3 = 1.0F; float f4 = (float) (entitywallpaper.wallpaper / 16) / 16.0F; float f5 = (float) (entitywallpaper.wallpaper % 16) / 16.0F; float f6 = 1.0F / 16.0F; float f7 = 1.0F / 512.0F; int i = MathHelper.floor_double(entitywallpaper.posX); int j = MathHelper.floor_double(entitywallpaper.posY); int k = MathHelper.floor_double(entitywallpaper.posZ); float lRed = (float) entitywallpaper.red / 256.0F; float lGreen = (float) entitywallpaper.green / 256.0F; float lBlue = (float) entitywallpaper.blue / 256.0F; tessellator.startDrawingQuads(); if (Minecraft.isAmbientOcclusionEnabled()) { renderWithAmbientOcclusion(i, j, k, 1.0F, 1.0F, 1.0F, entitywallpaper.direction); tessellator.setNormal(0.0F, 0.0F, 1F); tessellator.setBrightness(240); if (entitywallpaper.direction == 0) { tessellator.setColorOpaque_F( colorRedTopRight * lRed, colorGreenTopRight * lGreen, colorBlueTopRight * lBlue); tessellator.addVertexWithUV(f, f1, f2, f4 + f6, f5 + f6); tessellator.setColorOpaque_F( colorRedTopLeft * lRed, colorGreenTopLeft * lGreen, colorBlueTopLeft * lBlue); tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5); tessellator.setColorOpaque_F( colorRedBottomLeft * lRed, colorGreenBottomLeft * lGreen, colorBlueBottomLeft * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5); tessellator.setColorOpaque_F( colorRedBottomRight * lRed, colorGreenBottomRight * lGreen, colorBlueBottomRight * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6); } else if (entitywallpaper.direction == 2) { tessellator.setColorOpaque_F( colorRedBottomRight * lRed, colorGreenBottomRight * lGreen, colorBlueBottomRight * lBlue); tessellator.addVertexWithUV(f, f1, f2, f4 + f6, f5 + f6); tessellator.setColorOpaque_F( colorRedTopRight * lRed, colorGreenTopRight * lGreen, colorBlueTopRight * lBlue); tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5); tessellator.setColorOpaque_F( colorRedTopLeft * lRed, colorGreenTopLeft * lGreen, colorBlueTopLeft * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5); tessellator.setColorOpaque_F( colorRedBottomLeft * lRed, colorGreenBottomLeft * lGreen, colorBlueBottomLeft * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6); } else if (entitywallpaper.direction == 1) { tessellator.setColorOpaque_F( colorRedTopRight * lRed, colorGreenTopRight * lGreen, colorBlueTopRight * lBlue); tessellator.addVertexWithUV(f, f1, f2, f4 + f6, f5 + f6); tessellator.setColorOpaque_F( colorRedTopLeft * lRed, colorGreenTopLeft * lGreen, colorBlueTopLeft * lBlue); tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5); tessellator.setColorOpaque_F( colorRedBottomLeft * lRed, colorGreenBottomLeft * lGreen, colorBlueBottomLeft * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5); tessellator.setColorOpaque_F( colorRedBottomRight * lRed, colorGreenBottomRight * lGreen, colorBlueBottomRight * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6); } else if (entitywallpaper.direction == 3) { tessellator.setColorOpaque_F( colorRedBottomLeft * lRed, colorGreenBottomLeft * lGreen, colorBlueBottomLeft * lBlue); tessellator.addVertexWithUV(f, f1, f2, f4 + f6, f5 + f6); tessellator.setColorOpaque_F( colorRedBottomRight * lRed, colorGreenBottomRight * lGreen, colorBlueBottomRight * lBlue); tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5); tessellator.setColorOpaque_F( colorRedTopRight * lRed, colorGreenTopRight * lGreen, colorBlueTopRight * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5); tessellator.setColorOpaque_F( colorRedTopLeft * lRed, colorGreenTopLeft * lGreen, colorBlueTopLeft * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6); } if (!entitywallpaper.isBlockLeft) { tessellator.setNormal(-1.0F, 0.0F, 0.0F); if (entitywallpaper.direction == 0) { tessellator.setColorOpaque_F( colorRedTopLeft * lRed, colorGreenTopLeft * lGreen, colorBlueTopLeft * lBlue); tessellator.addVertexWithUV(f, f1 + 16.0F, f3, f4 + f6, f5); tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5); tessellator.setColorOpaque_F( colorRedTopRight * lRed, colorGreenTopRight * lGreen, colorBlueTopRight * lBlue); tessellator.addVertexWithUV(f, f1, f2, f4 + f6 - f7, f5 + f6); tessellator.addVertexWithUV(f, f1, f3, f4 + f6 - f7, f5 + f6); } else if (entitywallpaper.direction == 2) { tessellator.setColorOpaque_F( colorRedTopRight * lRed, colorGreenTopRight * lGreen, colorBlueTopRight * lBlue); tessellator.addVertexWithUV(f, f1 + 16.0F, f3, f4 + f6, f5); tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5); tessellator.setColorOpaque_F( colorRedBottomRight * lRed, colorGreenBottomRight * lGreen, colorBlueBottomRight * lBlue); tessellator.addVertexWithUV(f, f1, f2, f4 + f6 - f7, f5 + f6); tessellator.addVertexWithUV(f, f1, f3, f4 + f6 - f7, f5 + f6); } else if (entitywallpaper.direction == 1) { tessellator.setColorOpaque_F( colorRedTopLeft * lRed, colorGreenTopLeft * lGreen, colorBlueTopLeft * lBlue); tessellator.addVertexWithUV(f, f1 + 16.0F, f3, f4 + f6, f5); tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5); tessellator.setColorOpaque_F( colorRedTopRight * lRed, colorGreenTopRight * lGreen, colorBlueTopRight * lBlue); tessellator.addVertexWithUV(f, f1, f2, f4 + f6 - f7, f5 + f6); tessellator.addVertexWithUV(f, f1, f3, f4 + f6 - f7, f5 + f6); } else if (entitywallpaper.direction == 3) { tessellator.setColorOpaque_F( colorRedBottomRight * lRed, colorGreenBottomRight * lGreen, colorBlueBottomRight * lBlue); tessellator.addVertexWithUV(f, f1 + 16.0F, f3, f4 + f6, f5); tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5); tessellator.setColorOpaque_F( colorRedBottomLeft * lRed, colorGreenBottomLeft * lGreen, colorBlueBottomLeft * lBlue); tessellator.addVertexWithUV(f, f1, f2, f4 + f6 - f7, f5 + f6); tessellator.addVertexWithUV(f, f1, f3, f4 + f6 - f7, f5 + f6); } } if (!entitywallpaper.isBlockUp) { tessellator.setNormal(0.0F, 1.0F, 0.0F); if (entitywallpaper.direction == 0) { tessellator.setColorOpaque_F( colorRedTopLeft * lRed, colorGreenTopLeft * lGreen, colorBlueTopLeft * lBlue); tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5); tessellator.addVertexWithUV(f, f1 + 16.0F, f3, f4 + f6, f5 + f7); tessellator.setColorOpaque_F( colorRedBottomLeft * lRed, colorGreenBottomLeft * lGreen, colorBlueBottomLeft * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f3, f4, f5 + f7); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5); } else if (entitywallpaper.direction == 2) { tessellator.setColorOpaque_F( colorRedTopLeft * lRed, colorGreenTopLeft * lGreen, colorBlueTopLeft * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f3, f4, f5 + f7); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5); tessellator.setColorOpaque_F( colorRedTopRight * lRed, colorGreenTopRight * lGreen, colorBlueTopRight * lBlue); tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5); tessellator.addVertexWithUV(f, f1 + 16.0F, f3, f4 + f6, f5 + f7); } else if (entitywallpaper.direction == 1) { tessellator.setColorOpaque_F( colorRedBottomLeft * lRed, colorGreenBottomLeft * lGreen, colorBlueBottomLeft * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f3, f4, f5 + f7); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5); tessellator.setColorOpaque_F( colorRedTopLeft * lRed, colorGreenTopLeft * lGreen, colorBlueTopLeft * lBlue); tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5); tessellator.addVertexWithUV(f, f1 + 16.0F, f3, f4 + f6, f5 + f7); } else if (entitywallpaper.direction == 3) { tessellator.setColorOpaque_F( colorRedTopRight * lRed, colorGreenTopRight * lGreen, colorBlueTopRight * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f3, f4, f5 + f7); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5); tessellator.setColorOpaque_F( colorRedBottomRight * lRed, colorGreenBottomRight * lGreen, colorBlueBottomRight * lBlue); tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5); tessellator.addVertexWithUV(f, f1 + 16.0F, f3, f4 + f6, f5 + f7); } } if (!entitywallpaper.isBlockRight) { tessellator.setNormal(1F, 0.0F, 0.0F); if (entitywallpaper.direction == 0) { tessellator.setColorOpaque_F( colorRedBottomRight * lRed, colorGreenBottomRight * lGreen, colorBlueBottomRight * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1, f3, f4 + f7, f5 + f6); tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6); tessellator.setColorOpaque_F( colorRedBottomLeft * lRed, colorGreenBottomLeft * lGreen, colorBlueBottomLeft * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f3, f4 + f7, f5); } else if (entitywallpaper.direction == 2) { tessellator.setColorOpaque_F( colorRedBottomLeft * lRed, colorGreenBottomLeft * lGreen, colorBlueBottomLeft * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1, f3, f4 + f7, f5 + f6); tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6); tessellator.setColorOpaque_F( colorRedTopLeft * lRed, colorGreenTopLeft * lGreen, colorBlueTopLeft * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f3, f4 + f7, f5); } else if (entitywallpaper.direction == 1) { tessellator.setColorOpaque_F( colorRedBottomRight * lRed, colorGreenBottomRight * lGreen, colorBlueBottomRight * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1, f3, f4 + f7, f5 + f6); tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6); tessellator.setColorOpaque_F( colorRedBottomLeft * lRed, colorGreenBottomLeft * lGreen, colorBlueBottomLeft * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f3, f4 + f7, f5); } else if (entitywallpaper.direction == 3) { tessellator.setColorOpaque_F( colorRedTopLeft * lRed, colorGreenTopLeft * lGreen, colorBlueTopLeft * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1, f3, f4 + f7, f5 + f6); tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6); tessellator.setColorOpaque_F( colorRedTopRight * lRed, colorGreenTopRight * lGreen, colorBlueTopRight * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f3, f4 + f7, f5); } } if (!entitywallpaper.isBlockDown) { tessellator.setNormal(0.0F, -1.0F, 0.0F); if (entitywallpaper.direction == 0) { tessellator.setColorOpaque_F( colorRedTopRight * lRed, colorGreenTopRight * lGreen, colorBlueTopRight * lBlue); tessellator.addVertexWithUV(f, f1, f3, f4 + f6, f5 + f6 - f7); tessellator.addVertexWithUV(f, f1, f2, f4 + f6, f5 + f6); tessellator.setColorOpaque_F( colorRedBottomRight * lRed, colorGreenBottomRight * lGreen, colorBlueBottomRight * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6); tessellator.addVertexWithUV(f + 16.0F, f1, f3, f4, f5 + f6 - f7); } else if (entitywallpaper.direction == 2) { tessellator.setColorOpaque_F( colorRedBottomRight * lRed, colorGreenBottomRight * lGreen, colorBlueBottomRight * lBlue); tessellator.addVertexWithUV(f, f1, f3, f4 + f6, f5 + f6 - f7); tessellator.addVertexWithUV(f, f1, f2, f4 + f6, f5 + f6); tessellator.setColorOpaque_F( colorRedBottomLeft * lRed, colorGreenBottomLeft * lGreen, colorBlueBottomLeft * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6); tessellator.addVertexWithUV(f + 16.0F, f1, f3, f4, f5 + f6 - f7); } else if (entitywallpaper.direction == 1) { tessellator.setColorOpaque_F( colorRedTopRight * lRed, colorGreenTopRight * lGreen, colorBlueTopRight * lBlue); tessellator.addVertexWithUV(f, f1, f3, f4 + f6, f5 + f6 - f7); tessellator.addVertexWithUV(f, f1, f2, f4 + f6, f5 + f6); tessellator.setColorOpaque_F( colorRedBottomRight * lRed, colorGreenBottomRight * lGreen, colorBlueBottomRight * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6); tessellator.addVertexWithUV(f + 16.0F, f1, f3, f4, f5 + f6 - f7); } else if (entitywallpaper.direction == 3) { tessellator.setColorOpaque_F( colorRedBottomLeft * lRed, colorGreenBottomLeft * lGreen, colorBlueBottomLeft * lBlue); tessellator.addVertexWithUV(f, f1, f3, f4 + f6, f5 + f6 - f7); tessellator.addVertexWithUV(f, f1, f2, f4 + f6, f5 + f6); tessellator.setColorOpaque_F( colorRedTopLeft * lRed, colorGreenTopLeft * lGreen, colorBlueTopLeft * lBlue); tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6); tessellator.addVertexWithUV(f + 16.0F, f1, f3, f4, f5 + f6 - f7); } } } else { float lLightBlock = renderManager.worldObj.getLightBrightness(i, j, k); GL11.glColor3f( lLightBlock * (float) entitywallpaper.red / 256.0F, lLightBlock * (float) entitywallpaper.green / 256.0F, lLightBlock * (float) entitywallpaper.blue / 256.0F); tessellator.setBrightness(240); tessellator.setNormal(0.0F, 0.0F, -1F); tessellator.addVertexWithUV(f, f1, f2, f4 + f6, f5 + f6); tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5); tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6); if (!entitywallpaper.isBlockLeft) { tessellator.setNormal(-1.0F, 0.0F, 0.0F); tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5); tessellator.addVertexWithUV(f, f1, f2, f4 + f6 - f7, f5 + f6); tessellator.addVertexWithUV(f, f1, f3, f4 + f6 - f7, f5 + f6); tessellator.addVertexWithUV(f, f1 + 16.0F, f3, f4 + f6, f5); } if (!entitywallpaper.isBlockUp) { tessellator.setNormal(0.0F, 1.0F, 0.0F); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5); tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5); tessellator.addVertexWithUV(f, f1 + 16.0F, f3, f4 + f6, f5 + f7); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f3, f4, f5 + f7); } if (!entitywallpaper.isBlockRight) { tessellator.setNormal(1F, 0.0F, 0.0F); tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5); tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f3, f4 + f7, f5); tessellator.addVertexWithUV(f + 16.0F, f1, f3, f4 + f7, f5 + f6); } if (!entitywallpaper.isBlockDown) { tessellator.setNormal(0.0F, -1.0F, 0.0F); tessellator.addVertexWithUV(f, f1, f2, f4 + f6, f5 + f6); tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6); tessellator.addVertexWithUV(f + 16.0F, f1, f3, f4, f5 + f6 - f7); tessellator.addVertexWithUV(f, f1, f3, f4 + f6, f5 + f6 - f7); } } tessellator.draw(); }
/** Renders an item held in hand as a 2D texture with thickness */ public static void renderItemIn2D( Tessellator par0Tessellator, float par1, float par2, float par3, float par4, float par5) { float var6 = 1.0F; par0Tessellator.startDrawingQuads(); par0Tessellator.setNormal(0.0F, 0.0F, 1.0F); par0Tessellator.addVertexWithUV(0.0D, 0.0D, 0.0D, (double) par1, (double) par4); par0Tessellator.addVertexWithUV((double) var6, 0.0D, 0.0D, (double) par3, (double) par4); par0Tessellator.addVertexWithUV((double) var6, 1.0D, 0.0D, (double) par3, (double) par2); par0Tessellator.addVertexWithUV(0.0D, 1.0D, 0.0D, (double) par1, (double) par2); par0Tessellator.draw(); par0Tessellator.startDrawingQuads(); par0Tessellator.setNormal(0.0F, 0.0F, -1.0F); par0Tessellator.addVertexWithUV( 0.0D, 1.0D, (double) (0.0F - par5), (double) par1, (double) par2); par0Tessellator.addVertexWithUV( (double) var6, 1.0D, (double) (0.0F - par5), (double) par3, (double) par2); par0Tessellator.addVertexWithUV( (double) var6, 0.0D, (double) (0.0F - par5), (double) par3, (double) par4); par0Tessellator.addVertexWithUV( 0.0D, 0.0D, (double) (0.0F - par5), (double) par1, (double) par4); par0Tessellator.draw(); par0Tessellator.startDrawingQuads(); par0Tessellator.setNormal(-1.0F, 0.0F, 0.0F); int var7; float var8; float var9; float var10; for (var7 = 0; var7 < 16; ++var7) { var8 = (float) var7 / 16.0F; var9 = par1 + (par3 - par1) * var8 - 0.001953125F; var10 = var6 * var8; par0Tessellator.addVertexWithUV( (double) var10, 0.0D, (double) (0.0F - par5), (double) var9, (double) par4); par0Tessellator.addVertexWithUV((double) var10, 0.0D, 0.0D, (double) var9, (double) par4); par0Tessellator.addVertexWithUV((double) var10, 1.0D, 0.0D, (double) var9, (double) par2); par0Tessellator.addVertexWithUV( (double) var10, 1.0D, (double) (0.0F - par5), (double) var9, (double) par2); } par0Tessellator.draw(); par0Tessellator.startDrawingQuads(); par0Tessellator.setNormal(1.0F, 0.0F, 0.0F); for (var7 = 0; var7 < 16; ++var7) { var8 = (float) var7 / 16.0F; var9 = par1 + (par3 - par1) * var8 - 0.001953125F; var10 = var6 * var8 + 0.0625F; par0Tessellator.addVertexWithUV( (double) var10, 1.0D, (double) (0.0F - par5), (double) var9, (double) par2); par0Tessellator.addVertexWithUV((double) var10, 1.0D, 0.0D, (double) var9, (double) par2); par0Tessellator.addVertexWithUV((double) var10, 0.0D, 0.0D, (double) var9, (double) par4); par0Tessellator.addVertexWithUV( (double) var10, 0.0D, (double) (0.0F - par5), (double) var9, (double) par4); } par0Tessellator.draw(); par0Tessellator.startDrawingQuads(); par0Tessellator.setNormal(0.0F, 1.0F, 0.0F); for (var7 = 0; var7 < 16; ++var7) { var8 = (float) var7 / 16.0F; var9 = par4 + (par2 - par4) * var8 - 0.001953125F; var10 = var6 * var8 + 0.0625F; par0Tessellator.addVertexWithUV(0.0D, (double) var10, 0.0D, (double) par1, (double) var9); par0Tessellator.addVertexWithUV( (double) var6, (double) var10, 0.0D, (double) par3, (double) var9); par0Tessellator.addVertexWithUV( (double) var6, (double) var10, (double) (0.0F - par5), (double) par3, (double) var9); par0Tessellator.addVertexWithUV( 0.0D, (double) var10, (double) (0.0F - par5), (double) par1, (double) var9); } par0Tessellator.draw(); par0Tessellator.startDrawingQuads(); par0Tessellator.setNormal(0.0F, -1.0F, 0.0F); for (var7 = 0; var7 < 16; ++var7) { var8 = (float) var7 / 16.0F; var9 = par4 + (par2 - par4) * var8 - 0.001953125F; var10 = var6 * var8; par0Tessellator.addVertexWithUV( (double) var6, (double) var10, 0.0D, (double) par3, (double) var9); par0Tessellator.addVertexWithUV(0.0D, (double) var10, 0.0D, (double) par1, (double) var9); par0Tessellator.addVertexWithUV( 0.0D, (double) var10, (double) (0.0F - par5), (double) par1, (double) var9); par0Tessellator.addVertexWithUV( (double) var6, (double) var10, (double) (0.0F - par5), (double) par3, (double) var9); } par0Tessellator.draw(); }
/** Renders an item held in hand as a 2D texture with thickness */ private void renderItemIn2D( Tessellator par1Tessellator, float par2, float par3, float par4, float par5) { float f = 1.0F; float f1 = 0.0625F; par1Tessellator.startDrawingQuads(); par1Tessellator.setNormal(0.0F, 0.0F, 1.0F); par1Tessellator.addVertexWithUV(0.0D, 0.0D, 0.0D, par2, par5); par1Tessellator.addVertexWithUV(f, 0.0D, 0.0D, par4, par5); par1Tessellator.addVertexWithUV(f, 1.0D, 0.0D, par4, par3); par1Tessellator.addVertexWithUV(0.0D, 1.0D, 0.0D, par2, par3); par1Tessellator.draw(); par1Tessellator.startDrawingQuads(); par1Tessellator.setNormal(0.0F, 0.0F, -1F); par1Tessellator.addVertexWithUV(0.0D, 1.0D, 0.0F - f1, par2, par3); par1Tessellator.addVertexWithUV(f, 1.0D, 0.0F - f1, par4, par3); par1Tessellator.addVertexWithUV(f, 0.0D, 0.0F - f1, par4, par5); par1Tessellator.addVertexWithUV(0.0D, 0.0D, 0.0F - f1, par2, par5); par1Tessellator.draw(); par1Tessellator.startDrawingQuads(); par1Tessellator.setNormal(-1F, 0.0F, 0.0F); for (int i = 0; i < 16; i++) { float f2 = (float) i / 16F; float f6 = (par2 + (par4 - par2) * f2) - 0.001953125F; float f10 = f * f2; par1Tessellator.addVertexWithUV(f10, 0.0D, 0.0F - f1, f6, par5); par1Tessellator.addVertexWithUV(f10, 0.0D, 0.0D, f6, par5); par1Tessellator.addVertexWithUV(f10, 1.0D, 0.0D, f6, par3); par1Tessellator.addVertexWithUV(f10, 1.0D, 0.0F - f1, f6, par3); } par1Tessellator.draw(); par1Tessellator.startDrawingQuads(); par1Tessellator.setNormal(1.0F, 0.0F, 0.0F); for (int j = 0; j < 16; j++) { float f3 = (float) j / 16F; float f7 = (par2 + (par4 - par2) * f3) - 0.001953125F; float f11 = f * f3 + 0.0625F; par1Tessellator.addVertexWithUV(f11, 1.0D, 0.0F - f1, f7, par3); par1Tessellator.addVertexWithUV(f11, 1.0D, 0.0D, f7, par3); par1Tessellator.addVertexWithUV(f11, 0.0D, 0.0D, f7, par5); par1Tessellator.addVertexWithUV(f11, 0.0D, 0.0F - f1, f7, par5); } par1Tessellator.draw(); par1Tessellator.startDrawingQuads(); par1Tessellator.setNormal(0.0F, 1.0F, 0.0F); for (int k = 0; k < 16; k++) { float f4 = (float) k / 16F; float f8 = (par5 + (par3 - par5) * f4) - 0.001953125F; float f12 = f * f4 + 0.0625F; par1Tessellator.addVertexWithUV(0.0D, f12, 0.0D, par2, f8); par1Tessellator.addVertexWithUV(f, f12, 0.0D, par4, f8); par1Tessellator.addVertexWithUV(f, f12, 0.0F - f1, par4, f8); par1Tessellator.addVertexWithUV(0.0D, f12, 0.0F - f1, par2, f8); } par1Tessellator.draw(); par1Tessellator.startDrawingQuads(); par1Tessellator.setNormal(0.0F, -1F, 0.0F); for (int l = 0; l < 16; l++) { float f5 = (float) l / 16F; float f9 = (par5 + (par3 - par5) * f5) - 0.001953125F; float f13 = f * f5; par1Tessellator.addVertexWithUV(f, f13, 0.0D, par4, f9); par1Tessellator.addVertexWithUV(0.0D, f13, 0.0D, par2, f9); par1Tessellator.addVertexWithUV(0.0D, f13, 0.0F - f1, par2, f9); par1Tessellator.addVertexWithUV(f, f13, 0.0F - f1, par4, f9); } par1Tessellator.draw(); }
private void func_159_a(EntityBeams_Kaevator entitybeams, EnumBeams_Kaevator enumbeams) { GL11.glScalef( enumbeams.sizeX / 256.0F + 0.001F, enumbeams.sizeY / 256.0F + 0.001F, 1.0F / 16.0F); float f = -8.0F; float f1 = -8.0F; EnumPlanks_Kaevator lPlanks[] = EnumPlanks_Kaevator.values(); Tessellator tessellator = Tessellator.instance; for (int iPlank = 0; iPlank < enumbeams.planks.length; iPlank++) { int lCurPlank = enumbeams.planks[iPlank]; float f2 = lPlanks[lCurPlank].Zfront; float f3 = lPlanks[lCurPlank].Zback; float f4 = 0.5F * entitybeams.material; float f5 = 0.5F * (entitybeams.material + lPlanks[lCurPlank].TexSize); float f5_2 = 0.5F * (entitybeams.material + 0.5F); if (!enumbeams.isCollidable) { f5_2 = 0.5F * (entitybeams.material + 1.0F); } float lFactorX = (float) enumbeams.sizeX / 16.0F; float lFactorY = (float) enumbeams.sizeY / 16.0F; float lSide1 = (float) Math.sqrt( Math.pow( ((float) lPlanks[lCurPlank].X2 - (float) lPlanks[lCurPlank].X1) * lFactorX, 2) + Math.pow( ((float) lPlanks[lCurPlank].Y2 - (float) lPlanks[lCurPlank].Y1) * lFactorY, 2)); float lSide2 = (float) Math.sqrt( Math.pow( ((float) lPlanks[lCurPlank].X4 - (float) lPlanks[lCurPlank].X3) * lFactorX, 2) + Math.pow( ((float) lPlanks[lCurPlank].Y4 - (float) lPlanks[lCurPlank].Y3) * lFactorY, 2)); float lTexWrap = (lSide2 - lSide1) / (lSide2 * 2.0F); float lTexHeight = lSide2 / 32.0F; float f6 = lTexWrap * lTexHeight; float f7 = (1.0F - lTexWrap) * lTexHeight; float f8 = lTexHeight; float f9 = 0.0F; tessellator.startDrawingQuads(); func_160_a(entitybeams, entitybeams.red, entitybeams.green, entitybeams.blue); tessellator.setBrightness(240); tessellator.setNormal(0.0F, 0.0F, -1.0F); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X1, f1 + lPlanks[lCurPlank].Y1, f2, f4, f6); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X2, f1 + lPlanks[lCurPlank].Y2, f2, f4, f7); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X3, f1 + lPlanks[lCurPlank].Y3, f2, f5, f8); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X4, f1 + lPlanks[lCurPlank].Y4, f2, f5, f9); tessellator.setNormal(0.0F, 0.0F, 1.0F); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X4, f1 + lPlanks[lCurPlank].Y4, f3, f5, f9); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X3, f1 + lPlanks[lCurPlank].Y3, f3, f5, f8); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X2, f1 + lPlanks[lCurPlank].Y2, f3, f4, f7); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X1, f1 + lPlanks[lCurPlank].Y1, f3, f4, f6); tessellator.setNormal(0.0F, -1.0F, 0.0F); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X2, f1 + lPlanks[lCurPlank].Y2, f2, f5_2, f9); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X1, f1 + lPlanks[lCurPlank].Y1, f2, f5_2, f8); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X1, f1 + lPlanks[lCurPlank].Y1, f3, f4, f8); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X2, f1 + lPlanks[lCurPlank].Y2, f3, f4, f9); tessellator.setNormal(0.0F, -1.0F, 0.0F); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X3, f1 + lPlanks[lCurPlank].Y3, f2, f5_2, f8 / 3.0F); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X2, f1 + lPlanks[lCurPlank].Y2, f2, f5_2, f9); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X2, f1 + lPlanks[lCurPlank].Y2, f3, f4, f9); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X3, f1 + lPlanks[lCurPlank].Y3, f3, f4, f8 / 3.0F); tessellator.setNormal(0.0F, -1.0F, 0.0F); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X4, f1 + lPlanks[lCurPlank].Y4, f2, f5_2, f9); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X3, f1 + lPlanks[lCurPlank].Y3, f2, f5_2, f8); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X3, f1 + lPlanks[lCurPlank].Y3, f3, f4, f8); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X4, f1 + lPlanks[lCurPlank].Y4, f3, f4, f9); tessellator.setNormal(0.0F, -1.0F, 0.0F); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X1, f1 + lPlanks[lCurPlank].Y1, f2, f5_2, f8 / 3.0F); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X4, f1 + lPlanks[lCurPlank].Y4, f2, f5_2, f9); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X4, f1 + lPlanks[lCurPlank].Y4, f3, f4, f9); tessellator.addVertexWithUV( f + lPlanks[lCurPlank].X1, f1 + lPlanks[lCurPlank].Y1, f3, f4, f8 / 3.0F); tessellator.draw(); } }