Пример #1
0
 /** Renders the skybox in the main menu */
 private void renderSkybox(int par1, int par2, float par3) {
   GL11.glViewport(0, 0, 256, 256);
   drawPanorama(par1, par2, par3);
   GL11.glDisable(GL11.GL_TEXTURE_2D);
   GL11.glEnable(GL11.GL_TEXTURE_2D);
   rotateAndBlurSkybox(par3);
   rotateAndBlurSkybox(par3);
   rotateAndBlurSkybox(par3);
   rotateAndBlurSkybox(par3);
   rotateAndBlurSkybox(par3);
   rotateAndBlurSkybox(par3);
   rotateAndBlurSkybox(par3);
   rotateAndBlurSkybox(par3);
   GL11.glViewport(0, 0, mc.displayWidth, mc.displayHeight);
   Tessellator tessellator = Tessellator.instance;
   tessellator.startDrawingQuads();
   float f = width <= height ? 120F / (float) height : 120F / (float) width;
   float f1 = ((float) height * f) / 256F;
   float f2 = ((float) width * f) / 256F;
   GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR);
   GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);
   tessellator.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F);
   int i = width;
   int j = height;
   tessellator.addVertexWithUV(0.0D, j, zLevel, 0.5F - f1, 0.5F + f2);
   tessellator.addVertexWithUV(i, j, zLevel, 0.5F - f1, 0.5F - f2);
   tessellator.addVertexWithUV(i, 0.0D, zLevel, 0.5F + f1, 0.5F - f2);
   tessellator.addVertexWithUV(0.0D, 0.0D, zLevel, 0.5F + f1, 0.5F + f2);
   tessellator.draw();
 }
Пример #2
0
 private void renderMenuBlock(Block block, float f, RenderBlocks renderblocks) {
   int i = block.getRenderType();
   renderblocks.setRenderBoundsFromBlock(block);
   Tessellator tessellator = Tessellator.instance;
   if (i == 0) {
     block.setBlockBoundsForItemRender();
     GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
     float f1 = 0.5F;
     float f2 = 1.0F;
     float f3 = 0.8F;
     float f4 = 0.6F;
     tessellator.startDrawingQuads();
     tessellator.setColorRGBA_F(f2, f2, f2, f);
     renderblocks.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(0));
     tessellator.setColorRGBA_F(f1, f1, f1, f);
     renderblocks.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(1));
     tessellator.setColorRGBA_F(f3, f3, f3, f);
     renderblocks.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(2));
     renderblocks.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(3));
     tessellator.setColorRGBA_F(f4, f4, f4, f);
     renderblocks.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(4));
     renderblocks.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(5));
     tessellator.draw();
     GL11.glTranslatef(0.5F, 0.5F, 0.5F);
   }
 }
 public void drawLiquidRect(int startU, int startV, Icon par3Icon, int endU, int endV) {
   Tessellator tessellator = Tessellator.instance;
   tessellator.startDrawingQuads();
   tessellator.addVertexWithUV(
       startU + 0,
       startV + endV,
       this.zLevel,
       par3Icon.getMinU(),
       par3Icon.getMaxV()); // Bottom left
   tessellator.addVertexWithUV(
       startU + endU,
       startV + endV,
       this.zLevel,
       par3Icon.getMaxU(),
       par3Icon.getMaxV()); // Bottom right
   tessellator.addVertexWithUV(
       startU + endU,
       startV + 0,
       this.zLevel,
       par3Icon.getMaxU(),
       par3Icon.getMinV()); // Top right
   tessellator.addVertexWithUV(
       startU + 0, startV + 0, this.zLevel, par3Icon.getMinU(), par3Icon.getMinV()); // Top left
   tessellator.draw();
 }
Пример #4
0
  /** Rotate and blurs the skybox view in the main menu */
  private void rotateAndBlurSkybox(float par1) {
    mc.func_110434_K().func_110577_a(field_110351_G);
    GL11.glCopyTexSubImage2D(GL11.GL_TEXTURE_2D, 0, 0, 0, 0, 0, 256, 256);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glColorMask(true, true, true, false);
    Tessellator tessellator = Tessellator.instance;
    tessellator.startDrawingQuads();
    byte byte0 = 3;

    for (int i = 0; i < byte0; i++) {
      tessellator.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F / (float) (i + 1));
      int j = width;
      int k = height;
      float f = (float) (i - byte0 / 2) / 256F;
      tessellator.addVertexWithUV(j, k, zLevel, 0.0F + f, 0.0D);
      tessellator.addVertexWithUV(j, 0.0D, zLevel, 1.0F + f, 0.0D);
      tessellator.addVertexWithUV(0.0D, 0.0D, zLevel, 1.0F + f, 1.0D);
      tessellator.addVertexWithUV(0.0D, k, zLevel, 0.0F + f, 1.0D);
    }

    tessellator.draw();
    GL11.glColorMask(true, true, true, true);
  }
  public void func_1198_a() {
    if (!field_1738_u) {
      return;
    }
    field_1762_b++;
    int i = field_1761_c;
    int j = field_1760_d;
    int k = field_1759_e;
    int l = field_1761_c + field_1758_f;
    int i1 = field_1760_d + field_1757_g;
    int j1 = field_1759_e + field_1756_h;
    for (int k1 = 0; k1 < 2; k1++) {
      field_1748_p[k1] = true;
    }

    Chunk.field_1540_a = false;
    HashSet hashset = new HashSet();
    hashset.addAll(field_1745_B);
    field_1745_B.clear();
    int l1 = 1;
    ChunkCache chunkcache =
        new ChunkCache(field_1763_a, i - l1, j - l1, k - l1, l + l1, i1 + l1, j1 + l1);
    RenderBlocks renderblocks = new RenderBlocks(chunkcache);
    field_40590_G = 0;
    int i2 = 0;
    do {
      if (i2 >= 2) {
        break;
      }
      boolean flag = false;
      boolean flag1 = false;
      boolean flag2 = false;
      for (int j2 = j; j2 < i1; j2++) {
        for (int k2 = k; k2 < j1; k2++) {
          for (int l2 = i; l2 < l; l2++) {
            int i3 = chunkcache.func_600_a(l2, j2, k2);
            if (i3 <= 0) {
              continue;
            }
            if (!flag2) {
              flag2 = true;
              GL11.glNewList(field_1744_C + i2, 4864);
              GL11.glPushMatrix();
              func_1203_g();
              float f = 1.000001F;
              GL11.glTranslatef(
                  (float) (-field_1756_h) / 2.0F,
                  (float) (-field_1757_g) / 2.0F,
                  (float) (-field_1756_h) / 2.0F);
              GL11.glScalef(f, f, f);
              GL11.glTranslatef(
                  (float) field_1756_h / 2.0F,
                  (float) field_1757_g / 2.0F,
                  (float) field_1756_h / 2.0F);
              field_1742_D.func_977_b();
              field_1742_D.func_984_b(-field_1761_c, -field_1760_d, -field_1759_e);
            }
            if (i2 == 0 && Block.field_342_q[i3]) {
              TileEntity tileentity = chunkcache.func_603_b(l2, j2, k2);
              if (TileEntityRenderer.field_1554_a.func_1028_a(tileentity)) {
                field_1745_B.add(tileentity);
              }
            }
            Block block = Block.field_345_n[i3];
            int j3 = block.func_234_g();
            if (i2 == 0 && renderblocks.func_35927_a(l2, j2, k2, i2)) {
              flag1 = true;
            }
            if (j3 != i2) {
              flag = true;
              continue;
            }
            if (j3 == i2) {
              flag1 |= renderblocks.func_1234_a(block, l2, j2, k2);
            }
          }
        }
      }

      if (flag2) {
        field_40590_G += field_1742_D.func_982_a();
        GL11.glPopMatrix();
        GL11.glEndList();
        field_1742_D.func_984_b(0.0D, 0.0D, 0.0D);
      } else {
        flag1 = false;
      }
      if (flag1) {
        field_1748_p[i2] = false;
      }
      if (!flag) {
        break;
      }
      i2++;
    } while (true);
    HashSet hashset1 = new HashSet();
    hashset1.addAll(field_1745_B);
    hashset1.removeAll(hashset);
    field_1737_F.addAll(hashset1);
    hashset.removeAll(field_1745_B);
    field_1737_F.removeAll(hashset);
    field_1747_A = Chunk.field_1540_a;
    field_1739_E = true;
  }
Пример #6
0
 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);
 }
Пример #7
0
 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);
 }
Пример #8
0
  /** Draws the screen and all the components in it. */
  public void drawScreen(int par1, int par2, float par3) {
    if (panorama) {
      renderSkybox(par1, par2, par3);
    } else {
      drawDefaultBackground();
    }
    Tessellator tessellator = Tessellator.instance;
    if (oldlogo) {
      drawLogo(par3);
    }
    char c = 274;
    int i = width / 2 - c / 2;
    byte byte0 = 30;
    if (panorama) {
      drawGradientRect(0, 0, width, height, 0x80ffffff, 0xffffff);
      drawGradientRect(0, 0, width, height, 0, 0x80000000);
    }
    if (!oldlogo) {
      mc.func_110434_K().func_110577_a(field_110352_y);
      GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

      if ((double) updateCounter < 0.0001D) {
        drawTexturedModalRect(i + 0, byte0 + 0, 0, 0, 99, 44);
        drawTexturedModalRect(i + 99, byte0 + 0, 129, 0, 27, 44);
        drawTexturedModalRect(i + 99 + 26, byte0 + 0, 126, 0, 3, 44);
        drawTexturedModalRect(i + 99 + 26 + 3, byte0 + 0, 99, 0, 26, 44);
        drawTexturedModalRect(i + 155, byte0 + 0, 0, 45, 155, 44);
      } else {
        drawTexturedModalRect(i + 0, byte0 + 0, 0, 0, 155, 44);
        drawTexturedModalRect(i + 155, byte0 + 0, 0, 45, 155, 44);
      }
    }

    tessellator.setColorOpaque_I(0xffffff);
    GL11.glPushMatrix();
    GL11.glTranslatef(width / 2 + 90, 70F, 0.0F);
    GL11.glRotatef(-20F, 0.0F, 0.0F, 1.0F);
    float f =
        1.8F
            - MathHelper.abs(
                MathHelper.sin(
                        ((float) (Minecraft.getSystemTime() % 1000L) / 1000F)
                            * (float) Math.PI
                            * 2.0F)
                    * 0.1F);
    f = (f * 100F) / (float) (fontRenderer.getStringWidth(splashText) + 32);
    GL11.glScalef(f, f, f);
    drawCenteredString(fontRenderer, splashText, 0, -8, 0xffff00);
    GL11.glPopMatrix();
    String s = version.contains(":") ? version.split(":", 2)[1] : version;
    if (s.equals("OFF")) {
      s = "Minecraft " + (new CallableMinecraftVersion(null)).minecraftVersion();
    }

    if (mc.isDemo()) {
      s = (new StringBuilder()).append(s).append(" Demo").toString();
    }

    if (panorama) {
      drawString(fontRenderer, s, 2, height - 10, 0xffffff);
    } else {
      drawString(fontRenderer, s, 2, 2, 0x505050);
    }
    String s1 = "Copyright Mojang AB. Do not distribute!";
    drawString(
        fontRenderer, s1, width - fontRenderer.getStringWidth(s1) - 2, height - 10, 0xffffff);

    if (field_92025_p != null && field_92025_p.length() > 0) {
      drawRect(
          field_92022_t - 2, field_92021_u - 2, field_92020_v + 2, field_92019_w - 1, 0x55200000);
      drawString(fontRenderer, field_92025_p, field_92022_t, field_92021_u, 0xffffff);
      drawString(
          fontRenderer,
          field_96138_a,
          (width - field_92024_r) / 2,
          ((GuiButton) buttonList.get(0)).yPosition - 12,
          0xffffff);
    }

    super.drawScreen(par1, par2, par3);
  }
Пример #9
0
  /** Draws the main menu panorama */
  private void drawPanorama(int par1, int par2, float par3) {
    Tessellator tessellator = Tessellator.instance;
    GL11.glMatrixMode(GL11.GL_PROJECTION);
    GL11.glPushMatrix();
    GL11.glLoadIdentity();
    Project.gluPerspective(120F, 1.0F, 0.05F, 10F);
    GL11.glMatrixMode(GL11.GL_MODELVIEW);
    GL11.glPushMatrix();
    GL11.glLoadIdentity();
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glDisable(GL11.GL_ALPHA_TEST);
    GL11.glDisable(GL11.GL_CULL_FACE);
    GL11.glDepthMask(false);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    int i = 8;

    for (int j = 0; j < i * i; j++) {
      GL11.glPushMatrix();
      float f = ((float) (j % i) / (float) i - 0.5F) / 64F;
      float f1 = ((float) (j / i) / (float) i - 0.5F) / 64F;
      float f2 = 0.0F;
      GL11.glTranslatef(f, f1, f2);
      GL11.glRotatef(
          MathHelper.sin(((float) panoramaTimer + par3) / 400F) * 25F + 20F, 1.0F, 0.0F, 0.0F);
      GL11.glRotatef(-((float) panoramaTimer + par3) * 0.1F, 0.0F, 1.0F, 0.0F);

      for (int k = 0; k < 6; k++) {
        GL11.glPushMatrix();

        if (k == 1) {
          GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F);
        }

        if (k == 2) {
          GL11.glRotatef(180F, 0.0F, 1.0F, 0.0F);
        }

        if (k == 3) {
          GL11.glRotatef(-90F, 0.0F, 1.0F, 0.0F);
        }

        if (k == 4) {
          GL11.glRotatef(90F, 1.0F, 0.0F, 0.0F);
        }

        if (k == 5) {
          GL11.glRotatef(-90F, 1.0F, 0.0F, 0.0F);
        }

        mc.func_110434_K().func_110577_a(titlePanoramaPaths[k]);
        tessellator.startDrawingQuads();
        tessellator.setColorRGBA_I(0xffffff, 255 / (j + 1));
        float f3 = 0.0F;
        tessellator.addVertexWithUV(-1D, -1D, 1.0D, 0.0F + f3, 0.0F + f3);
        tessellator.addVertexWithUV(1.0D, -1D, 1.0D, 1.0F - f3, 0.0F + f3);
        tessellator.addVertexWithUV(1.0D, 1.0D, 1.0D, 1.0F - f3, 1.0F - f3);
        tessellator.addVertexWithUV(-1D, 1.0D, 1.0D, 0.0F + f3, 1.0F - f3);
        tessellator.draw();
        GL11.glPopMatrix();
      }

      GL11.glPopMatrix();
      GL11.glColorMask(true, true, true, false);
    }

    tessellator.setTranslation(0.0D, 0.0D, 0.0D);
    GL11.glColorMask(true, true, true, true);
    GL11.glMatrixMode(GL11.GL_PROJECTION);
    GL11.glPopMatrix();
    GL11.glMatrixMode(GL11.GL_MODELVIEW);
    GL11.glPopMatrix();
    GL11.glDepthMask(true);
    GL11.glEnable(GL11.GL_CULL_FACE);
    GL11.glEnable(GL11.GL_ALPHA_TEST);
    GL11.glEnable(GL11.GL_DEPTH_TEST);
  }
  public static boolean renderBlockRedstoneWire(
      RenderBlocks r,
      IBlockAccess blockAccess,
      Block par1Block,
      int par2,
      int par3,
      int par4,
      Icon override) {
    Tessellator tessellator = Tessellator.instance;

    int i = blockAccess.getBlockMetadata(par2, par3, par4);
    Icon icon = BlockRedstoneWire.func_94409_b("cross");
    Icon icon1 = BlockRedstoneWire.func_94409_b("line");
    Icon icon2 = BlockRedstoneWire.func_94409_b("cross_overlay");
    Icon icon3 = BlockRedstoneWire.func_94409_b("line_overlay");
    if (!Minecraft.oldlighting) {
      tessellator.setBrightness(
          par1Block.getMixedBrightnessForBlock(blockAccess, par2, par3, par4));
    }
    float f =
        Minecraft.oldlighting ? par1Block.getBlockBrightness(blockAccess, par2, par3, par4) : 1.0F;
    float f1 = (float) i / 15F;
    float f2 = f1 * 0.6F + 0.4F;

    if (i == 0) {
      f2 = 0.3F;
    }

    float f3 = f1 * f1 * 0.7F - 0.5F;
    float f4 = f1 * f1 * 0.6F - 0.7F;

    if (f3 < 0.0F) {
      f3 = 0.0F;
    }

    if (f4 < 0.0F) {
      f4 = 0.0F;
    }

    tessellator.setColorOpaque_F(f * f2, f * f3, f * f4);
    boolean flag =
        BlockRedstoneWire.isPowerProviderOrWire(blockAccess, par2 - 1, par3, par4, 1)
            || !blockAccess.isBlockNormalCube(par2 - 1, par3, par4)
                && BlockRedstoneWire.isPowerProviderOrWire(
                    blockAccess, par2 - 1, par3 - 1, par4, -1);
    boolean flag1 =
        BlockRedstoneWire.isPowerProviderOrWire(blockAccess, par2 + 1, par3, par4, 3)
            || !blockAccess.isBlockNormalCube(par2 + 1, par3, par4)
                && BlockRedstoneWire.isPowerProviderOrWire(
                    blockAccess, par2 + 1, par3 - 1, par4, -1);
    boolean flag2 =
        BlockRedstoneWire.isPowerProviderOrWire(blockAccess, par2, par3, par4 - 1, 2)
            || !blockAccess.isBlockNormalCube(par2, par3, par4 - 1)
                && BlockRedstoneWire.isPowerProviderOrWire(
                    blockAccess, par2, par3 - 1, par4 - 1, -1);
    boolean flag3 =
        BlockRedstoneWire.isPowerProviderOrWire(blockAccess, par2, par3, par4 + 1, 0)
            || !blockAccess.isBlockNormalCube(par2, par3, par4 + 1)
                && BlockRedstoneWire.isPowerProviderOrWire(
                    blockAccess, par2, par3 - 1, par4 + 1, -1);

    if (!blockAccess.isBlockNormalCube(par2, par3 + 1, par4)) {
      if (blockAccess.isBlockNormalCube(par2 - 1, par3, par4)
          && BlockRedstoneWire.isPowerProviderOrWire(blockAccess, par2 - 1, par3 + 1, par4, -1)) {
        flag = true;
      }

      if (blockAccess.isBlockNormalCube(par2 + 1, par3, par4)
          && BlockRedstoneWire.isPowerProviderOrWire(blockAccess, par2 + 1, par3 + 1, par4, -1)) {
        flag1 = true;
      }

      if (blockAccess.isBlockNormalCube(par2, par3, par4 - 1)
          && BlockRedstoneWire.isPowerProviderOrWire(blockAccess, par2, par3 + 1, par4 - 1, -1)) {
        flag2 = true;
      }

      if (blockAccess.isBlockNormalCube(par2, par3, par4 + 1)
          && BlockRedstoneWire.isPowerProviderOrWire(blockAccess, par2, par3 + 1, par4 + 1, -1)) {
        flag3 = true;
      }
    }

    float f5 = par2 + 0;
    float f6 = par2 + 1;
    float f7 = par4 + 0;
    float f8 = par4 + 1;
    byte byte0 = 0;

    if ((flag || flag1) && !flag2 && !flag3) {
      byte0 = 1;
    }

    if ((flag2 || flag3) && !flag1 && !flag) {
      byte0 = 2;
    }

    if (byte0 == 0) {
      int j = 0;
      int k = 0;
      int l = 16;
      int i1 = 16;

      if (flag1 || flag2 || flag3 || flag) {
        if (!flag) {
          f5 += 0.3125F;
        }

        if (!flag) {
          j += 5;
        }

        if (!flag1) {
          f6 -= 0.3125F;
        }

        if (!flag1) {
          l -= 5;
        }

        if (!flag2) {
          f7 += 0.3125F;
        }

        if (!flag2) {
          k += 5;
        }

        if (!flag3) {
          f8 -= 0.3125F;
        }

        if (!flag3) {
          i1 -= 5;
        }
      }

      tessellator.addVertexWithUV(
          f6, (double) par3 + 0.015625D, f8, icon.getInterpolatedU(l), icon.getInterpolatedV(i1));
      tessellator.addVertexWithUV(
          f6, (double) par3 + 0.015625D, f7, icon.getInterpolatedU(l), icon.getInterpolatedV(k));
      tessellator.addVertexWithUV(
          f5, (double) par3 + 0.015625D, f7, icon.getInterpolatedU(j), icon.getInterpolatedV(k));
      tessellator.addVertexWithUV(
          f5, (double) par3 + 0.015625D, f8, icon.getInterpolatedU(j), icon.getInterpolatedV(i1));
      tessellator.setColorOpaque_F(f, f, f);
      tessellator.addVertexWithUV(
          f6, (double) par3 + 0.015625D, f8, icon2.getInterpolatedU(l), icon2.getInterpolatedV(i1));
      tessellator.addVertexWithUV(
          f6, (double) par3 + 0.015625D, f7, icon2.getInterpolatedU(l), icon2.getInterpolatedV(k));
      tessellator.addVertexWithUV(
          f5, (double) par3 + 0.015625D, f7, icon2.getInterpolatedU(j), icon2.getInterpolatedV(k));
      tessellator.addVertexWithUV(
          f5, (double) par3 + 0.015625D, f8, icon2.getInterpolatedU(j), icon2.getInterpolatedV(i1));
    } else if (byte0 == 1) {
      tessellator.addVertexWithUV(
          f6, (double) par3 + 0.015625D, f8, icon1.getMaxU(), icon1.getMaxV());
      tessellator.addVertexWithUV(
          f6, (double) par3 + 0.015625D, f7, icon1.getMaxU(), icon1.getMinV());
      tessellator.addVertexWithUV(
          f5, (double) par3 + 0.015625D, f7, icon1.getMinU(), icon1.getMinV());
      tessellator.addVertexWithUV(
          f5, (double) par3 + 0.015625D, f8, icon1.getMinU(), icon1.getMaxV());
      tessellator.setColorOpaque_F(f, f, f);
      tessellator.addVertexWithUV(
          f6, (double) par3 + 0.015625D, f8, icon3.getMaxU(), icon3.getMaxV());
      tessellator.addVertexWithUV(
          f6, (double) par3 + 0.015625D, f7, icon3.getMaxU(), icon3.getMinV());
      tessellator.addVertexWithUV(
          f5, (double) par3 + 0.015625D, f7, icon3.getMinU(), icon3.getMinV());
      tessellator.addVertexWithUV(
          f5, (double) par3 + 0.015625D, f8, icon3.getMinU(), icon3.getMaxV());
    } else {
      tessellator.addVertexWithUV(
          f6, (double) par3 + 0.015625D, f8, icon1.getMaxU(), icon1.getMaxV());
      tessellator.addVertexWithUV(
          f6, (double) par3 + 0.015625D, f7, icon1.getMinU(), icon1.getMaxV());
      tessellator.addVertexWithUV(
          f5, (double) par3 + 0.015625D, f7, icon1.getMinU(), icon1.getMinV());
      tessellator.addVertexWithUV(
          f5, (double) par3 + 0.015625D, f8, icon1.getMaxU(), icon1.getMinV());
      tessellator.setColorOpaque_F(f, f, f);
      tessellator.addVertexWithUV(
          f6, (double) par3 + 0.015625D, f8, icon3.getMaxU(), icon3.getMaxV());
      tessellator.addVertexWithUV(
          f6, (double) par3 + 0.015625D, f7, icon3.getMinU(), icon3.getMaxV());
      tessellator.addVertexWithUV(
          f5, (double) par3 + 0.015625D, f7, icon3.getMinU(), icon3.getMinV());
      tessellator.addVertexWithUV(
          f5, (double) par3 + 0.015625D, f8, icon3.getMaxU(), icon3.getMinV());
    }

    if (!blockAccess.isBlockNormalCube(par2, par3 + 1, par4)) {
      if (blockAccess.isBlockNormalCube(par2 - 1, par3, par4)
          && blockAccess.getBlockId(par2 - 1, par3 + 1, par4) == Block.redstoneWire.blockID) {
        tessellator.setColorOpaque_F(f * f2, f * f3, f * f4);
        tessellator.addVertexWithUV(
            (double) par2 + 0.015625D,
            (float) (par3 + 1) + 0.021875F,
            par4 + 1,
            icon1.getMaxU(),
            icon1.getMinV());
        tessellator.addVertexWithUV(
            (double) par2 + 0.015625D, par3 + 0, par4 + 1, icon1.getMinU(), icon1.getMinV());
        tessellator.addVertexWithUV(
            (double) par2 + 0.015625D, par3 + 0, par4 + 0, icon1.getMinU(), icon1.getMaxV());
        tessellator.addVertexWithUV(
            (double) par2 + 0.015625D,
            (float) (par3 + 1) + 0.021875F,
            par4 + 0,
            icon1.getMaxU(),
            icon1.getMaxV());
        tessellator.setColorOpaque_F(f, f, f);
        tessellator.addVertexWithUV(
            (double) par2 + 0.015625D,
            (float) (par3 + 1) + 0.021875F,
            par4 + 1,
            icon3.getMaxU(),
            icon3.getMinV());
        tessellator.addVertexWithUV(
            (double) par2 + 0.015625D, par3 + 0, par4 + 1, icon3.getMinU(), icon3.getMinV());
        tessellator.addVertexWithUV(
            (double) par2 + 0.015625D, par3 + 0, par4 + 0, icon3.getMinU(), icon3.getMaxV());
        tessellator.addVertexWithUV(
            (double) par2 + 0.015625D,
            (float) (par3 + 1) + 0.021875F,
            par4 + 0,
            icon3.getMaxU(),
            icon3.getMaxV());
      }

      if (blockAccess.isBlockNormalCube(par2 + 1, par3, par4)
          && blockAccess.getBlockId(par2 + 1, par3 + 1, par4) == Block.redstoneWire.blockID) {
        tessellator.setColorOpaque_F(f * f2, f * f3, f * f4);
        tessellator.addVertexWithUV(
            (double) (par2 + 1) - 0.015625D, par3 + 0, par4 + 1, icon1.getMinU(), icon1.getMaxV());
        tessellator.addVertexWithUV(
            (double) (par2 + 1) - 0.015625D,
            (float) (par3 + 1) + 0.021875F,
            par4 + 1,
            icon1.getMaxU(),
            icon1.getMaxV());
        tessellator.addVertexWithUV(
            (double) (par2 + 1) - 0.015625D,
            (float) (par3 + 1) + 0.021875F,
            par4 + 0,
            icon1.getMaxU(),
            icon1.getMinV());
        tessellator.addVertexWithUV(
            (double) (par2 + 1) - 0.015625D, par3 + 0, par4 + 0, icon1.getMinU(), icon1.getMinV());
        tessellator.setColorOpaque_F(f, f, f);
        tessellator.addVertexWithUV(
            (double) (par2 + 1) - 0.015625D, par3 + 0, par4 + 1, icon3.getMinU(), icon3.getMaxV());
        tessellator.addVertexWithUV(
            (double) (par2 + 1) - 0.015625D,
            (float) (par3 + 1) + 0.021875F,
            par4 + 1,
            icon3.getMaxU(),
            icon3.getMaxV());
        tessellator.addVertexWithUV(
            (double) (par2 + 1) - 0.015625D,
            (float) (par3 + 1) + 0.021875F,
            par4 + 0,
            icon3.getMaxU(),
            icon3.getMinV());
        tessellator.addVertexWithUV(
            (double) (par2 + 1) - 0.015625D, par3 + 0, par4 + 0, icon3.getMinU(), icon3.getMinV());
      }

      if (blockAccess.isBlockNormalCube(par2, par3, par4 - 1)
          && blockAccess.getBlockId(par2, par3 + 1, par4 - 1) == Block.redstoneWire.blockID) {
        tessellator.setColorOpaque_F(f * f2, f * f3, f * f4);
        tessellator.addVertexWithUV(
            par2 + 1, par3 + 0, (double) par4 + 0.015625D, icon1.getMinU(), icon1.getMaxV());
        tessellator.addVertexWithUV(
            par2 + 1,
            (float) (par3 + 1) + 0.021875F,
            (double) par4 + 0.015625D,
            icon1.getMaxU(),
            icon1.getMaxV());
        tessellator.addVertexWithUV(
            par2 + 0,
            (float) (par3 + 1) + 0.021875F,
            (double) par4 + 0.015625D,
            icon1.getMaxU(),
            icon1.getMinV());
        tessellator.addVertexWithUV(
            par2 + 0, par3 + 0, (double) par4 + 0.015625D, icon1.getMinU(), icon1.getMinV());
        tessellator.setColorOpaque_F(f, f, f);
        tessellator.addVertexWithUV(
            par2 + 1, par3 + 0, (double) par4 + 0.015625D, icon3.getMinU(), icon3.getMaxV());
        tessellator.addVertexWithUV(
            par2 + 1,
            (float) (par3 + 1) + 0.021875F,
            (double) par4 + 0.015625D,
            icon3.getMaxU(),
            icon3.getMaxV());
        tessellator.addVertexWithUV(
            par2 + 0,
            (float) (par3 + 1) + 0.021875F,
            (double) par4 + 0.015625D,
            icon3.getMaxU(),
            icon3.getMinV());
        tessellator.addVertexWithUV(
            par2 + 0, par3 + 0, (double) par4 + 0.015625D, icon3.getMinU(), icon3.getMinV());
      }

      if (blockAccess.isBlockNormalCube(par2, par3, par4 + 1)
          && blockAccess.getBlockId(par2, par3 + 1, par4 + 1) == Block.redstoneWire.blockID) {
        tessellator.setColorOpaque_F(f * f2, f * f3, f * f4);
        tessellator.addVertexWithUV(
            par2 + 1,
            (float) (par3 + 1) + 0.021875F,
            (double) (par4 + 1) - 0.015625D,
            icon1.getMaxU(),
            icon1.getMinV());
        tessellator.addVertexWithUV(
            par2 + 1, par3 + 0, (double) (par4 + 1) - 0.015625D, icon1.getMinU(), icon1.getMinV());
        tessellator.addVertexWithUV(
            par2 + 0, par3 + 0, (double) (par4 + 1) - 0.015625D, icon1.getMinU(), icon1.getMaxV());
        tessellator.addVertexWithUV(
            par2 + 0,
            (float) (par3 + 1) + 0.021875F,
            (double) (par4 + 1) - 0.015625D,
            icon1.getMaxU(),
            icon1.getMaxV());
        tessellator.setColorOpaque_F(f, f, f);
        tessellator.addVertexWithUV(
            par2 + 1,
            (float) (par3 + 1) + 0.021875F,
            (double) (par4 + 1) - 0.015625D,
            icon3.getMaxU(),
            icon3.getMinV());
        tessellator.addVertexWithUV(
            par2 + 1, par3 + 0, (double) (par4 + 1) - 0.015625D, icon3.getMinU(), icon3.getMinV());
        tessellator.addVertexWithUV(
            par2 + 0, par3 + 0, (double) (par4 + 1) - 0.015625D, icon3.getMinU(), icon3.getMaxV());
        tessellator.addVertexWithUV(
            par2 + 0,
            (float) (par3 + 1) + 0.021875F,
            (double) (par4 + 1) - 0.015625D,
            icon3.getMaxU(),
            icon3.getMaxV());
      }
    }

    return true;
  }