void drawSpike(
      IIcon icon, double r, double h, double x, double y, double z, double dx, double dz) {
    Tessellator tessellator = Tessellator.instance;

    double u0 = icon.getMinU();
    double u1 = icon.getMaxU();
    double v0 = icon.getMaxV();
    double v1 = icon.getMinV();

    double tx = x + dx;
    double ty = y + h;
    double tz = z + dz;

    tessellator.addVertexWithUV(x + r, y + 0, z + r, u0, v0);
    tessellator.addVertexWithUV(x + r, y + 0, z - r, u1, v0);
    tessellator.addVertexWithUV(tx, ty, tz, u1, v1);
    tessellator.addVertexWithUV(tx, ty, tz, u0, v1);

    tessellator.addVertexWithUV(x - r, y + 0, z + r, u1, v0);
    tessellator.addVertexWithUV(x + r, y + 0, z + r, u0, v0);
    tessellator.addVertexWithUV(tx, ty, tz, u1, v1);
    tessellator.addVertexWithUV(tx, ty, tz, u0, v1);

    tessellator.addVertexWithUV(x + r, y + 0, z - r, u1, v0);
    tessellator.addVertexWithUV(x - r, y + 0, z - r, u0, v0);
    tessellator.addVertexWithUV(tx, ty, tz, u1, v1);
    tessellator.addVertexWithUV(tx, ty, tz, u0, v1);

    tessellator.addVertexWithUV(x - r, y + 0, z - r, u1, v0);
    tessellator.addVertexWithUV(x - r, y + 0, z + r, u0, v0);
    tessellator.addVertexWithUV(tx, ty, tz, u1, v1);
    tessellator.addVertexWithUV(tx, ty, tz, u0, v1);
  }
  private void renderWhirlwind(
      EntityWhirlwind whirlwind, double x, double y, double z, float f, float f1) {
    GL11.glPushMatrix();

    Minecraft.getMinecraft().renderEngine.bindTexture(rLoc);

    Tessellator tessellator = Tessellator.instance;
    IIcon IIcon = AMParticleIcons.instance.getIconByName("wind");

    GL11.glTranslated(x, y, z);

    float f4 = 1.0F;
    float f5 = 0.5F;
    float f6 = 0.25F;
    float min_u = IIcon.getMinU();
    float min_v = IIcon.getMinV();
    float max_u = IIcon.getMaxU();
    float max_v = IIcon.getMaxV();

    GL11.glRotatef(180F - RenderManager.instance.playerViewY, 0.0F, 1.0F, 0.0F);
    GL11.glRotatef(-RenderManager.instance.playerViewX, 1.0F, 0.0F, 0.0F);

    tessellator.startDrawingQuads();
    tessellator.setBrightness(0xF00F0);
    tessellator.addVertexWithUV(0.0F - f5, 0.0F - f6, 0.0D, min_u, max_v);
    tessellator.addVertexWithUV(f4 - f5, 0.0F - f6, 0.0D, max_u, max_v);
    tessellator.addVertexWithUV(f4 - f5, f4 - f6, 0.0D, max_u, min_v);
    tessellator.addVertexWithUV(0.0F - f5, f4 - f6, 0.0D, min_u, min_v);
    tessellator.draw();

    GL11.glPopMatrix();
  }
  protected void renderParticleQuad(
      Tessellator tessellator,
      float partialTickTime,
      Double3 currentPos,
      Double3 previousPos,
      Double3 vec1,
      Double3 vec2,
      IIcon icon,
      double scale) {
    float minU = icon.getMinU();
    float maxU = icon.getMaxU();
    float minV = icon.getMinV();
    float maxV = icon.getMaxV();

    Double3 center =
        new Double3(
            previousPos.x + (currentPos.x - previousPos.x) * partialTickTime - interpPosX,
            previousPos.y + (currentPos.y - previousPos.y) * partialTickTime - interpPosY,
            previousPos.z + (currentPos.z - previousPos.z) * partialTickTime - interpPosZ);

    addVertex(tessellator, center.sub(vec1.scale(scale)), maxU, maxV);
    addVertex(tessellator, center.sub(vec2.scale(scale)), maxU, minV);
    addVertex(tessellator, center.add(vec1.scale(scale)), minU, minV);
    addVertex(tessellator, center.add(vec2.scale(scale)), minU, maxV);
  }
  public void renderLiquids(TileEntity tile) {
    if (tile != null && tile instanceof TileInjector) {
      TileInjector t = (TileInjector) tile;
      List<FluidTank> l = t.getFluidTanks();

      GL11.glPushMatrix();

      if (l.get(0) != null && l.get(0).getFluid() != null && l.get(0).getFluidAmount() > 0) {
        IIcon ic = l.get(0).getFluid().getFluid().getStillIcon();
        int amount = l.get(0).getFluidAmount() > 0 ? l.get(0).getFluidAmount() : 1;
        float ratio = (float) amount / (float) l.get(0).getCapacity();
        Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
        Tessellator tessellator = Tessellator.instance;
        double ts = 16.0D;
        double minU = (double) ic.getInterpolatedU(0 * ts);
        double maxU = (double) ic.getInterpolatedU(1 * ts);
        double minV = (double) ic.getInterpolatedV(0 * ts);
        double maxV = (double) ic.getInterpolatedV(1 * ts);
        double d7 = maxU;
        double d8 = minU;
        double d9 = minV;
        double d10 = maxV;
        double rt = 0.001953125D;
        tessellator.startDrawingQuads();
        tessellator.setNormal(0.0F, 1.0F, 0.0F);
        tessellator.addVertexWithUV(
            0.48, -0.133 + 0.3 * ratio, 0.18, maxU - ts * 0.64 * rt, maxV - ts * 0.64 * rt);
        tessellator.addVertexWithUV(0.48, -0.133 + 0.3 * ratio, -0.18, d7 - ts * 0.64 * rt, d9);
        tessellator.addVertexWithUV(0.12, -0.133 + 0.3 * ratio, -0.18, minU, minV);
        tessellator.addVertexWithUV(0.12, -0.133 + 0.3 * ratio, 0.18, d8, d10 - ts * 0.64 * rt);
        tessellator.draw();
        tessellator.startDrawingQuads();
        tessellator.addVertexWithUV(
            0.48, -0.133, -0.18, maxU - ts * 0.64 * rt, maxV - ts * (1 - 0.3 * ratio) * rt);
        tessellator.addVertexWithUV(0.48, -0.133 + 0.3 * ratio, -0.18, d7 - ts * 0.64 * rt, d9);
        tessellator.addVertexWithUV(0.48, -0.133 + 0.3 * ratio, 0.18, minU, minV);
        tessellator.addVertexWithUV(0.48, -0.133, 0.18, d8, d10 - ts * (1 - 0.3 * ratio) * rt);
        tessellator.draw();

        GL11.glRotatef(180, 0F, 1F, 0F);
        tessellator.startDrawingQuads();
        tessellator.setNormal(0.0F, 1.0F, 0.0F);
        tessellator.addVertexWithUV(
            0.435, -0.41 + 0.4 * ratio, 0.40, maxU - ts * 0.465 * rt, maxV - ts * 0.20 * rt);
        tessellator.addVertexWithUV(0.435, -0.41 + 0.4 * ratio, -0.40, d7 - ts * 0.465 * rt, d9);
        tessellator.addVertexWithUV(-0.1, -0.41 + 0.4 * ratio, -0.40, minU, minV);
        tessellator.addVertexWithUV(-0.1, -0.41 + 0.4 * ratio, 0.40, d8, d10 - ts * 0.20 * rt);
        tessellator.draw();
        tessellator.startDrawingQuads();
        tessellator.addVertexWithUV(
            0.435, -0.41, -0.40, maxU - ts * 0.20 * rt, maxV - ts * (1 - 0.4 * ratio) * rt);
        tessellator.addVertexWithUV(0.435, -0.41 + 0.4 * ratio, -0.40, d7 - ts * 0.20 * rt, d9);
        tessellator.addVertexWithUV(0.435, -0.41 + 0.4 * ratio, 0.40, minU, minV);
        tessellator.addVertexWithUV(0.435, -0.41, 0.40, d8, d10 - ts * (1 - 0.4 * ratio) * rt);
        tessellator.draw();
      }
      GL11.glPopMatrix();
    }
  }
Example #5
0
  private void renderEntityOnFire(
      Entity par1Entity, double par2, double par4, double par6, float par8) {
    GL11.glDisable(GL11.GL_LIGHTING);
    IIcon icon = Blocks.fire.getFireIcon(0);
    IIcon icon1 = Blocks.fire.getFireIcon(1);
    GL11.glPushMatrix();
    GL11.glTranslatef((float) par2, (float) par4, (float) par6);
    float f1 = par1Entity.width * 1.4F;

    EntityFlameFireball entityFireball = (EntityFlameFireball) par1Entity;
    f1 *= entityFireball.fireballMaxGrowth / entityFireball.fireballGrowth;

    GL11.glScalef(f1, f1, f1);
    Tessellator tessellator = Tessellator.instance;
    float f2 = 0.5F;
    float f3 = 0.0F;
    float f4 = par1Entity.height / f1;
    float f5 = (float) (par1Entity.posY - par1Entity.boundingBox.minY);
    GL11.glRotatef(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
    GL11.glTranslatef(0.0F, 0.0F, -0.3F + (float) ((int) f4) * 0.02F);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    float f6 = 0.0F;
    int i = 0;
    tessellator.startDrawingQuads();

    while (f4 > 0.0F) {
      IIcon icon2 = i % 2 == 0 ? icon : icon1;
      this.bindTexture(TextureMap.locationBlocksTexture);
      float f7 = icon2.getMinU();
      float f8 = icon2.getMinV();
      float f9 = icon2.getMaxU();
      float f10 = icon2.getMaxV();

      if (i / 2 % 2 == 0) {
        float f11 = f9;
        f9 = f7;
        f7 = f11;
      }

      tessellator.addVertexWithUV(
          (double) (f2 - f3), (double) (0.0F - f5), (double) f6, (double) f9, (double) f10);
      tessellator.addVertexWithUV(
          (double) (-f2 - f3), (double) (0.0F - f5), (double) f6, (double) f7, (double) f10);
      tessellator.addVertexWithUV(
          (double) (-f2 - f3), (double) (1.4F - f5), (double) f6, (double) f7, (double) f8);
      tessellator.addVertexWithUV(
          (double) (f2 - f3), (double) (1.4F - f5), (double) f6, (double) f9, (double) f8);
      f4 -= 0.45F;
      f5 -= 0.45F;
      f2 *= 0.9F;
      f6 += 0.03F;
      ++i;
    }

    tessellator.draw();
    GL11.glPopMatrix();
    GL11.glEnable(GL11.GL_LIGHTING);
  }
 /**
  * Adds a vertex to the tessellator scaled to the unit size of a block. Same as {@link
  * #addScaledVertexWithUV(Tessellator, float, float, float, float, float)}, but does not require
  * the correct texture to be bound.
  *
  * @param tessellator
  * @param x the x position, from 0 to {@value Constants.WHOLE}.
  * @param y the y position, from 0 to {@value Constants.WHOLE}.
  * @param z the z position, from 0 to {@value Constants.WHOLE}.
  * @param u ???
  * @param v ???
  * @param icon the texture of the point.
  */
 public static void addScaledVertexWithUV(
     Tessellator tessellator, float x, float y, float z, float u, float v, IIcon icon) {
   tessellator.addVertexWithUV(
       x * Constants.UNIT,
       y * Constants.UNIT,
       z * Constants.UNIT,
       icon.getInterpolatedU(u),
       icon.getInterpolatedV(v));
 }
 public static void renderItemIntoGUI(
     FontRenderer fontRenderer,
     ItemStack itemStack,
     int x,
     int y,
     float opacity,
     float scale,
     int zLevel) {
   IIcon icon = itemStack.getIconIndex();
   GL11.glDisable(GL11.GL_LIGHTING);
   FMLClientHandler.instance()
       .getClient()
       .renderEngine
       .bindTexture(TextureMap.locationItemsTexture);
   int overlayColour = itemStack.getItem().getColorFromItemStack(itemStack, 0);
   float red = (overlayColour >> 16 & 255) / 255.0F;
   float green = (overlayColour >> 8 & 255) / 255.0F;
   float blue = (overlayColour & 255) / 255.0F;
   GL11.glColor4f(red, green, blue, opacity);
   Tessellator tessellator = Tessellator.instance;
   tessellator.startDrawingQuads();
   tessellator.addVertexWithUV(x, y + 16 * scale, zLevel, icon.getMinU(), icon.getMaxV());
   tessellator.addVertexWithUV(
       x + 16 * scale, y + 16 * scale, zLevel, icon.getMaxU(), icon.getMaxV());
   tessellator.addVertexWithUV(x + 16 * scale, y, zLevel, icon.getMaxU(), icon.getMinV());
   tessellator.addVertexWithUV(x, y, zLevel, icon.getMinU(), icon.getMinV());
   tessellator.draw();
   GL11.glEnable(GL11.GL_LIGHTING);
 }
  private static void renderCoreWithTex(final IIcon cone, final Tessellator tex) {
    final float minU = cone.getMinU();
    final float minV = cone.getMinV();
    final float maxU = cone.getMaxU();
    final float maxV = cone.getMaxV();

    renderNorthFace(tex, minU, minV, maxU, maxV);
    renderWestFace(tex, minU, minV, maxU, maxV);
    renderSouthFace(tex, minU, minV, maxU, maxV);
    renderEastFace(tex, minU, minV, maxU, maxV);
  }
  void rebindUVsToIcon(WavefrontObject model, IIcon icon) {
    float minU = icon.getInterpolatedU(0);
    float sizeU = icon.getInterpolatedU(16) - minU;
    float minV = icon.getInterpolatedV(0);
    float sizeV = icon.getInterpolatedV(16) - minV;

    for (GroupObject groupObject : model.groupObjects)
      for (Face face : groupObject.faces)
        for (int i = 0; i < face.vertices.length; ++i) {
          TextureCoordinate textureCoordinate = face.textureCoordinates[i];
          face.textureCoordinates[i] =
              new TextureCoordinate(
                  minU + sizeU * textureCoordinate.u, minV + sizeV * textureCoordinate.v);
        }
  }
Example #10
0
  @Override
  public boolean renderWorldBlock(
      IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
    IIcon icon = RenderBlocks.getInstance().getBlockIconFromSideAndMetadata(block, 0, 0);

    float minU = icon.getMinU();
    float minV = icon.getMinV();
    float maxU = icon.getMaxU();
    float maxV = icon.getMaxV();

    Tessellator t = Tessellator.instance;

    int lightValue = block.getMixedBrightnessForBlock(world, x, y, z);
    t.setColorOpaque_F(1.0F, 1.0F, 1.0F);

    // Bottom
    t.addVertexWithUV(x + 0, y + 0, z + 0, minU, minV);
    t.addVertexWithUV(x + 1, y + 0, z + 0, maxU, minV);
    t.addVertexWithUV(x + 1, y + 0, z + 1, maxU, maxV);
    t.addVertexWithUV(x + 0, y + 0, z + 1, minU, maxV);
    // Top
    t.addVertexWithUV(x + 0, y + 1, z + 1, minU, maxV);
    t.addVertexWithUV(x + 1, y + 1, z + 1, maxU, maxV);
    t.addVertexWithUV(x + 1, y + 1, z + 0, maxU, minV);
    t.addVertexWithUV(x + 0, y + 1, z + 0, minU, minV);
    // Side
    t.addVertexWithUV(x + 0, y + 0, z + 1, minU, maxV);
    t.addVertexWithUV(x + 0, y + 1, z + 1, maxU, maxV);
    t.addVertexWithUV(x + 0, y + 1, z + 0, maxU, minV);
    t.addVertexWithUV(x + 0, y + 0, z + 0, minU, minV);
    // Side
    t.addVertexWithUV(x + 1, y + 0, z + 0, minU, minV);
    t.addVertexWithUV(x + 1, y + 1, z + 0, maxU, minV);
    t.addVertexWithUV(x + 1, y + 1, z + 1, maxU, maxV);
    t.addVertexWithUV(x + 1, y + 0, z + 1, minU, maxV);
    // Side
    t.addVertexWithUV(x + 1, y + 0, z + 1, minU, maxV);
    t.addVertexWithUV(x + 1, y + 1, z + 1, maxU, maxV);
    t.addVertexWithUV(x + 0, y + 1, z + 1, maxU, minV);
    t.addVertexWithUV(x + 0, y + 0, z + 1, minU, minV);
    // Side
    t.addVertexWithUV(x + 0, y + 0, z + 0, minU, minV);
    t.addVertexWithUV(x + 0, y + 1, z + 0, maxU, minV);
    t.addVertexWithUV(x + 1, y + 1, z + 0, maxU, maxV);
    t.addVertexWithUV(x + 1, y + 0, z + 0, minU, maxV);

    return false;
  }
 private void renderLiquid(TileEntity tile, double par2, double par4, double par6) {
   GL11.glTranslated(par2, par4, par6);
   TileEntityFillingStation tr = (TileEntityFillingStation) tile;
   double dx = 0;
   double dz = 0;
   double ddx = 0;
   double ddz = 0;
   switch (tr.getBlockMetadata()) {
     case 0:
       dx = 0.25;
       break;
     case 1:
       ddx = 0.25;
       break;
     case 2:
       dz = 0.25;
       break;
     case 3:
       ddz = 0.25;
       break;
   }
   if (!tr.isEmpty() && tr.isInWorld()) {
     Fluid f = tr.getFluid();
     if (!f.equals(FluidRegistry.LAVA)) {
       GL11.glEnable(GL11.GL_BLEND);
     }
     ReikaLiquidRenderer.bindFluidTexture(f);
     IIcon ico = f.getIcon();
     float u = ico.getMinU();
     float v = ico.getMinV();
     float du = ico.getMaxU();
     float dv = ico.getMaxV();
     double h = 0.0625 + 14D / 16D * tr.getLevel() / tr.CAPACITY;
     Tessellator v5 = Tessellator.instance;
     if (f.getLuminosity() > 0) ReikaRenderHelper.disableLighting();
     v5.startDrawingQuads();
     v5.setNormal(0, 1, 0);
     v5.addVertexWithUV(dx + 0, h, -ddz + 1, u, dv);
     v5.addVertexWithUV(-ddx + 1, h, -ddz + 1, du, dv);
     v5.addVertexWithUV(-ddx + 1, h, dz + 0, du, v);
     v5.addVertexWithUV(dx + 0, h, dz + 0, u, v);
     v5.draw();
     ReikaRenderHelper.enableLighting();
   }
   GL11.glTranslated(-par2, -par4, -par6);
   GL11.glDisable(GL11.GL_BLEND);
 }
 /**
  * Retrieves a resource location from an <em>item</em> icon.
  *
  * @param icon the icon to get the resource location from.
  * @return the resource location for the icon, or null.
  */
 public static ResourceLocation getItemResource(IIcon icon) {
   if (icon == null) {
     return null;
   }
   String path = icon.getIconName();
   String domain = path.substring(0, path.indexOf(":") + 1);
   String file = path.substring(path.indexOf(':') + 1);
   return new ResourceLocation(domain + "textures/items/" + file + ".png");
 }
Example #13
0
  public void render(double x, double y, double z, int color, boolean inworld) {
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glEnable(GL11.GL_BLEND);
    Tessellator v5 = Tessellator.instance;
    spline.render(v5, 0.5, 0.5, 0.5, color, inworld, true, 32);

    IIcon ico = ChromaIcons.FADE.getIcon();
    float u = ico.getMinU();
    float v = ico.getMinV();
    float du = ico.getMaxU();
    float dv = ico.getMaxV();
    BlendMode.ADDITIVEDARK.apply();
    ReikaTextureHelper.bindTerrainTexture();
    GL11.glPushMatrix();
    GL11.glTranslated(0.5, 0.5, 0.5);

    if (inworld) {
      RenderManager rm = RenderManager.instance;
      double dx = x - RenderManager.renderPosX;
      double dy = y - RenderManager.renderPosY;
      double dz = z - RenderManager.renderPosZ;
      double[] angs = ReikaPhysicsHelper.cartesianToPolar(dx, dy, dz);
      GL11.glRotated(angs[2], 0, 1, 0);
      GL11.glRotated(90 - angs[1], 1, 0, 0);
    }

    double d = 1.25;

    double pz = 0.05;

    v5.startDrawingQuads();
    int a = 160;
    v5.setColorRGBA_I(ReikaColorAPI.getColorWithBrightnessMultiplier(color, a / 255F), a);
    v5.addVertexWithUV(-d, -d, pz, u, v);
    v5.addVertexWithUV(d, -d, pz, du, v);
    v5.addVertexWithUV(d, d, pz, du, dv);
    v5.addVertexWithUV(-d, d, pz, u, dv);
    v5.draw();

    BlendMode.DEFAULT.apply();
    GL11.glPopMatrix();

    GL11.glEnable(GL11.GL_LIGHTING);
  }
 /*
  * This method has been stolen from BuildCraft
  */
 private void drawCutIcon(IIcon icon, int x, int y, int width, int height, int cut) {
   Tessellator tess = Tessellator.instance;
   tess.startDrawingQuads();
   tess.addVertexWithUV(x, y + height, zLevel, icon.getMinU(), icon.getInterpolatedV(height));
   tess.addVertexWithUV(
       x + width, y + height, zLevel, icon.getInterpolatedU(width), icon.getInterpolatedV(height));
   tess.addVertexWithUV(
       x + width, y + cut, zLevel, icon.getInterpolatedU(width), icon.getInterpolatedV(cut));
   tess.addVertexWithUV(x, y + cut, zLevel, icon.getMinU(), icon.getInterpolatedV(cut));
   tess.draw();
 }
Example #15
0
  @Nullable
  private static String getIconName(IIcon icon) {
    if (icon == null) return null;

    String iconName = icon.getIconName();

    if (RendererHandler.items.getTextureExtry(iconName) != null
        || RendererHandler.blocks.getTextureExtry(iconName) != null) return iconName;
    else return null;
  }
  private void drawRectangleFromIcon(int x, int y, IIcon icon, int width, int height) {
    if (icon == null) return;
    double minU = icon.getMinU();
    double maxU = icon.getMaxU();
    double minV = icon.getMinV();
    double maxV = icon.getMaxV();

    Tessellator tessellator = Tessellator.instance;
    tessellator.startDrawingQuads();
    tessellator.addVertexWithUV(x + 0, y + height, 0, minU, minV + (maxV - minV) * height / 16.0D);
    tessellator.addVertexWithUV(
        x + width,
        y + height,
        0,
        minU + (maxU - minU) * width / 16.0D,
        minV + (maxV - minV) * height / 16.0D);
    tessellator.addVertexWithUV(x + width, y + 0, 0, minU + (maxU - minU) * width / 16.0D, minV);
    tessellator.addVertexWithUV(x + 0, y + 0, 0, minU, minV);
    tessellator.draw();
  }
 private void drawCrossedSquares(
     IBlockAccess blockAccess,
     double x,
     double y,
     double z,
     float size,
     Block block,
     int meta,
     RenderBlocks renderer) {
   Tessellator tessellator = Tessellator.instance;
   IIcon icon = renderer.getBlockIcon(block, blockAccess, (int) x, (int) y, (int) z, meta);
   if (renderer.hasOverrideBlockTexture()) {
     icon = renderer.overrideBlockTexture;
   }
   double minU = (double) icon.getMinU();
   double minV = (double) icon.getMinV();
   double maxU = (double) icon.getMaxU();
   double maxV = (double) icon.getMaxV();
   double scaledSize = 0.45D * (double) size;
   double minX = x + 0.5D - scaledSize;
   double maxX = x + 0.5D + scaledSize;
   double minZ = z + 0.5D - scaledSize;
   double maxZ = z + 0.5D + scaledSize;
   tessellator.addVertexWithUV(minX, y + (double) size, minZ, minU, minV);
   tessellator.addVertexWithUV(minX, y + 0.0D, minZ, minU, maxV);
   tessellator.addVertexWithUV(maxX, y + 0.0D, maxZ, maxU, maxV);
   tessellator.addVertexWithUV(maxX, y + (double) size, maxZ, maxU, minV);
   tessellator.addVertexWithUV(maxX, y + (double) size, maxZ, minU, minV);
   tessellator.addVertexWithUV(maxX, y + 0.0D, maxZ, minU, maxV);
   tessellator.addVertexWithUV(minX, y + 0.0D, minZ, maxU, maxV);
   tessellator.addVertexWithUV(minX, y + (double) size, minZ, maxU, minV);
   tessellator.addVertexWithUV(minX, y + (double) size, maxZ, minU, minV);
   tessellator.addVertexWithUV(minX, y + 0.0D, maxZ, minU, maxV);
   tessellator.addVertexWithUV(maxX, y + 0.0D, minZ, maxU, maxV);
   tessellator.addVertexWithUV(maxX, y + (double) size, minZ, maxU, minV);
   tessellator.addVertexWithUV(maxX, y + (double) size, minZ, minU, minV);
   tessellator.addVertexWithUV(maxX, y + 0.0D, minZ, minU, maxV);
   tessellator.addVertexWithUV(minX, y + 0.0D, maxZ, maxU, maxV);
   tessellator.addVertexWithUV(minX, y + (double) size, maxZ, maxU, minV);
 }
 private void func_77026_a(Tessellator par1Tessellator, IIcon par2Icon) {
   float f = par2Icon.getMinU();
   float f1 = par2Icon.getMaxU();
   float f2 = par2Icon.getMinV();
   float f3 = par2Icon.getMaxV();
   float f4 = 1.0F;
   float f5 = 0.5F;
   float f6 = 0.25F;
   GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
   GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
   par1Tessellator.startDrawingQuads();
   par1Tessellator.setNormal(0.0F, 1.0F, 0.0F);
   par1Tessellator.addVertexWithUV(
       (double) (0.0F - f5), (double) (0.0F - f6), 0.0D, (double) f, (double) f3);
   par1Tessellator.addVertexWithUV(
       (double) (f4 - f5), (double) (0.0F - f6), 0.0D, (double) f1, (double) f3);
   par1Tessellator.addVertexWithUV(
       (double) (f4 - f5), (double) (f4 - f6), 0.0D, (double) f1, (double) f2);
   par1Tessellator.addVertexWithUV(
       (double) (0.0F - f5), (double) (f4 - f6), 0.0D, (double) f, (double) f2);
   par1Tessellator.draw();
 }
 private void drawFluids(int recipe) {
   CentrifugeRecipe r = (CentrifugeRecipe) arecipes.get(recipe);
   ItemStack in = r.input;
   FluidStack fs = RecipesCentrifuge.getRecipes().getFluidResult(in);
   if (fs != null) {
     Fluid f = fs.getFluid();
     IIcon ico = f.getIcon();
     float u = ico.getMinU();
     float v = ico.getMinV();
     float du = ico.getMaxU();
     float dv = ico.getMaxV();
     ReikaTextureHelper.bindTerrainTexture();
     Tessellator v5 = Tessellator.instance;
     v5.startDrawingQuads();
     int x = 147;
     for (int i = 0; i < 4; i++) {
       int y = 1 + i * 16;
       v5.addVertexWithUV(x, y, 0, u, v);
       v5.addVertexWithUV(x, y + 16, 0, u, dv);
       v5.addVertexWithUV(x + 16, y + 16, 0, du, dv);
       v5.addVertexWithUV(x + 16, y, 0, du, v);
     }
     v5.addVertexWithUV(x, 65, 0, u, v);
     v5.addVertexWithUV(x, 68, 0, u, dv);
     v5.addVertexWithUV(x + 16, 68, 0, du, dv);
     v5.addVertexWithUV(x + 16, 65, 0, du, v);
     v5.draw();
     FontRenderer fr = Minecraft.getMinecraft().fontRenderer;
     String s =
         f.getLocalizedName()
             + " ("
             + fs.amount
             + " mB) ("
             + RecipesCentrifuge.getRecipes().getFluidChance(in)
             + "%)";
     int l = fr.getStringWidth(s);
     fr.drawString(s, 166 - l, 70, 0);
   }
 }
Example #20
0
  private void DrawIconAtXY(
      IIcon IIcon, String base, float x, float y, int w, int h, boolean semitransparent) {

    if (IIcon == null) return;

    Tessellator tessellator = Tessellator.instance;
    tessellator.startDrawingQuads();

    tessellator.addVertexWithUV(x, y + h, this.zLevel, IIcon.getMinU(), IIcon.getMaxV());
    tessellator.addVertexWithUV(x + w, y + h, this.zLevel, IIcon.getMaxU(), IIcon.getMaxV());
    tessellator.addVertexWithUV(x + w, y, this.zLevel, IIcon.getMaxU(), IIcon.getMinV());
    tessellator.addVertexWithUV(x, y, this.zLevel, IIcon.getMinU(), IIcon.getMinV());

    tessellator.draw();
  }
	@Override
	public void doRender(Entity entity, double x, double y, double z, float _, float partialTickTime) {
		bindEntityTexture(entity);
		GL11.glPushMatrix();
		float yaw = RenderUtils.interpolateYaw(entity, partialTickTime);
		float pitch = RenderUtils.interpolatePitch(entity, partialTickTime);

		GL11.glTranslated(x, y, z);
		GL11.glRotatef(yaw, 0, 1, 0);
		GL11.glRotatef(pitch, 1, 0, 0);
		final IIcon icon = Items.goldenEye.getIconFromDamage(0);

		GL11.glScaled(1.0 / 6.0, 1.0 / 6.0, 1.0 / 6.0);
		Tessellator tes = new Tessellator();
		tes.setTranslation(-0.5, -0.5, 0);
		ItemRenderer.renderItemIn2D(
				tes,
				icon.getInterpolatedU(15), icon.getInterpolatedV(2),
				icon.getInterpolatedU(2), icon.getInterpolatedV(15),
				13, 13,
				1.0f / 16.0f
				);
		GL11.glPopMatrix();
	}
Example #22
0
  private void DrawPartialIconAtXY(
      IIcon IIcon,
      float pct_x,
      float pct_y,
      float x,
      float y,
      float w,
      float h,
      boolean semitransparent) {
    if (IIcon == null) return;

    mc.renderEngine.bindTexture(items);

    Tessellator tessellator = Tessellator.instance;
    tessellator.startDrawingQuads();

    tessellator.addVertexWithUV(x, y + (h * pct_y), this.zLevel, IIcon.getMinU(), IIcon.getMaxV());
    tessellator.addVertexWithUV(
        x + (w * pct_x), y + (h * pct_y), this.zLevel, IIcon.getMaxU(), IIcon.getMaxV());
    tessellator.addVertexWithUV(x + (w * pct_x), y, this.zLevel, IIcon.getMaxU(), IIcon.getMinV());
    tessellator.addVertexWithUV(x, y, this.zLevel, IIcon.getMinU(), IIcon.getMinV());

    tessellator.draw();
  }
  protected void doRenderItem(
      ItemRenderType type, ItemStack item, Item iconItem, FluidStack fluid) {

    IIcon icon = iconItem.getIcon(item, 0);
    IIcon mask = iconItem.getIcon(item, 1);
    boolean hasFluid = fluid != null;

    IIcon fluidIcon = hasFluid ? fluid.getFluid().getIcon(fluid) : mask;
    int fluidSheet = hasFluid ? fluid.getFluid().getSpriteNumber() : 0;
    int colorMult = hasFluid ? fluid.getFluid().getColor(fluid) : 0xFFFFFF;
    boolean isFloaty = hasFluid ? fluid.getFluid().getDensity(fluid) < 0 : false;

    if (fluid == null) {
      fluidIcon = Blocks.flowing_lava.getIcon(2, 0);
      fluidSheet = 0;
      colorMult = 0x3F3F3F;
    }
    GL11.glPushMatrix();

    Tessellator tessellator = Tessellator.instance;

    float iconMinX = icon.getMinU();
    float iconMaxX = icon.getMaxU();
    float iconMinY = icon.getMinV();
    float iconMaxY = icon.getMaxV();

    float maskMinX = mask.getMinU();
    float maskMaxX = mask.getMaxU();
    float maskMinY = mask.getMinV();
    float maskMaxY = mask.getMaxV();

    float fluidMinX = fluidIcon.getMinU();
    float fluidMaxX = fluidIcon.getMaxU();
    float fluidMinY = fluidIcon.getMinV();
    float fluidMaxY = fluidIcon.getMaxV();

    if (isFloaty && canFlip) {
      iconMaxY = icon.getMinV();
      iconMinY = icon.getMaxV();

      maskMaxY = mask.getMinV();
      maskMinY = mask.getMaxV();

      fluidMaxY = fluidIcon.getMinV();
      fluidMinY = fluidIcon.getMaxV();
    }
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glEnable(GL11.GL_ALPHA_TEST);
    OpenGlHelper.glBlendFunc(
        GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
    int texture = GL11.glGetInteger(GL11.GL_TEXTURE_BINDING_2D);

    if (type == ItemRenderType.INVENTORY) {
      GL11.glDisable(GL11.GL_LIGHTING);

      tessellator.startDrawingQuads();
      tessellator.addVertexWithUV(0, 16, 0, iconMinX, iconMaxY);
      tessellator.addVertexWithUV(16, 16, 0, iconMaxX, iconMaxY);
      tessellator.addVertexWithUV(16, 0, 0, iconMaxX, iconMinY);
      tessellator.addVertexWithUV(0, 0, 0, iconMinX, iconMinY);
      tessellator.draw();

      if (hasFluid) {
        tessellator.startDrawingQuads();
        tessellator.addVertexWithUV(0, 16, 0.001, maskMinX, maskMaxY);
        tessellator.addVertexWithUV(16, 16, 0.001, maskMaxX, maskMaxY);
        tessellator.addVertexWithUV(16, 0, 0.001, maskMaxX, maskMinY);
        tessellator.addVertexWithUV(0, 0, 0.001, maskMinX, maskMinY);
        tessellator.draw();

        GL11.glEnable(GL11.GL_CULL_FACE);
        GL11.glDepthFunc(GL11.GL_EQUAL);
        GL11.glDepthMask(false);
        GL11.glMatrixMode(GL11.GL_TEXTURE);
        bindTexture(RenderHelper.engine(), fluidSheet);
        OpenGlHelper.glBlendFunc(GL11.GL_ONE, GL11.GL_ZERO, GL11.GL_ONE, GL11.GL_ZERO);

        tessellator.startDrawingQuads();
        tessellator.setColorOpaque_I(colorMult);
        tessellator.addVertexWithUV(0, 16, 0.001, fluidMinX, fluidMaxY);
        tessellator.addVertexWithUV(16, 16, 0.001, fluidMaxX, fluidMaxY);
        tessellator.addVertexWithUV(16, 0, 0.001, fluidMaxX, fluidMinY);
        tessellator.addVertexWithUV(0, 0, 0.001, fluidMinX, fluidMinY);
        tessellator.draw();

        GL11.glMatrixMode(GL11.GL_MODELVIEW);
        GL11.glDepthMask(true);
        GL11.glDepthFunc(GL11.GL_LEQUAL);
      }

      GL11.glEnable(GL11.GL_LIGHTING);
    } else {
      GL11.glEnable(GL12.GL_RESCALE_NORMAL);

      if (type == ItemRenderType.ENTITY) {
        GL11.glTranslatef(0.5f, 4 / -16f, 0);
        GL11.glRotatef(180, 0, 1, 0);
      }
      ItemRenderer.renderItemIn2D(
          tessellator,
          iconMaxX,
          iconMinY,
          iconMinX,
          iconMaxY,
          icon.getIconWidth(),
          icon.getIconHeight(),
          0.0625F);

      if (hasFluid) {
        tessellator.startDrawingQuads();
        tessellator.setNormal(0, 0, 1);
        tessellator.addVertexWithUV(0, 0, 0.001, maskMaxX, maskMaxY);
        tessellator.addVertexWithUV(1, 0, 0.001, maskMinX, maskMaxY);
        tessellator.addVertexWithUV(1, 1, 0.001, maskMinX, maskMinY);
        tessellator.addVertexWithUV(0, 1, 0.001, maskMaxX, maskMinY);
        tessellator.draw();
        tessellator.startDrawingQuads();
        tessellator.setNormal(0, 0, -1);
        tessellator.addVertexWithUV(0, 1, -0.0635, maskMinX, maskMinY);
        tessellator.addVertexWithUV(1, 1, -0.0635, maskMaxX, maskMinY);
        tessellator.addVertexWithUV(1, 0, -0.0635, maskMaxX, maskMaxY);
        tessellator.addVertexWithUV(0, 0, -0.0635, maskMinX, maskMaxY);
        tessellator.draw();

        GL11.glEnable(GL11.GL_CULL_FACE);
        GL11.glDepthFunc(GL11.GL_EQUAL);
        GL11.glDepthMask(false);
        bindTexture(RenderHelper.engine(), fluidSheet);
        OpenGlHelper.glBlendFunc(GL11.GL_ONE, GL11.GL_ZERO, GL11.GL_ONE, GL11.GL_ZERO);

        tessellator.startDrawingQuads();
        tessellator.setNormal(0, 0, 1);
        tessellator.setColorOpaque_I(colorMult);
        tessellator.addVertexWithUV(0, 0, 0.001, fluidMaxX, fluidMaxY);
        tessellator.addVertexWithUV(1, 0, 0.001, fluidMinX, fluidMaxY);
        tessellator.addVertexWithUV(1, 1, 0.001, fluidMinX, fluidMinY);
        tessellator.addVertexWithUV(0, 1, 0.001, fluidMaxX, fluidMinY);
        tessellator.draw();

        tessellator.startDrawingQuads();
        tessellator.setNormal(0, 0, -1);
        tessellator.setColorOpaque_I(colorMult);
        tessellator.addVertexWithUV(0, 1, -0.0635, fluidMinX, fluidMinY);
        tessellator.addVertexWithUV(1, 1, -0.0635, fluidMaxX, fluidMinY);
        tessellator.addVertexWithUV(1, 0, -0.0635, fluidMaxX, fluidMaxY);
        tessellator.addVertexWithUV(0, 0, -0.0635, fluidMinX, fluidMaxY);
        tessellator.draw();

        GL11.glDepthMask(true);
        GL11.glDepthFunc(GL11.GL_LEQUAL);
      }
      GL11.glDisable(GL12.GL_RESCALE_NORMAL);
    }

    GL11.glBindTexture(GL11.GL_TEXTURE_2D, texture);
    OpenGlHelper.glBlendFunc(
        GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
    GL11.glDisable(GL11.GL_ALPHA_TEST);
    GL11.glPopMatrix();
  }
  private void renderPylon(int posX, int posY) {
    float mod = 2000F;
    int tick = (int) ((System.currentTimeMillis() / (double) mod) % 16);
    CrystalElement e1 = CrystalElement.elements[tick];
    CrystalElement e2 = CrystalElement.elements[(tick + 1) % 16];
    float mix = (float) (System.currentTimeMillis() % (double) mod) / mod;
    mix = Math.min(mix * 2, 1);
    int c1 = e1.getColor();
    int c2 = e2.getColor();
    int color = ReikaColorAPI.mixColors(c2, c1, mix);
    ReikaTextureHelper.bindTerrainTexture();
    Tessellator v5 = Tessellator.instance;
    v5.setBrightness(240);
    v5.startDrawingQuads();
    v5.setColorOpaque_I(color);
    IIcon ico = ChromaIcons.ROUNDFLARE.getIcon();
    GL11.glEnable(GL11.GL_BLEND);
    BlendMode.ADDITIVEDARK.apply();
    float u = ico.getMinU();
    float v = ico.getMinV();
    float du = ico.getMaxU();
    float dv = ico.getMaxV();
    int w = 96;
    int x = posX + 115;
    int y = posY - 4;
    v5.addVertexWithUV(x, y + w, 0, u, dv);
    v5.addVertexWithUV(x + w, y + w, 0, du, dv);
    v5.addVertexWithUV(x + w, y, 0, du, v);
    v5.addVertexWithUV(x, y, 0, u, v);

    ico = ChromaIcons.BIGFLARE.getIcon();
    u = ico.getMinU();
    v = ico.getMinV();
    du = ico.getMaxU();
    dv = ico.getMaxV();
    w = 8;

    Iterator<PylonParticle> it = particles.iterator();
    while (it.hasNext()) {
      PylonParticle p = it.next();
      v5.addVertexWithUV(p.posX, p.posY + w, 0, u, dv);
      v5.addVertexWithUV(p.posX + w, p.posY + w, 0, du, dv);
      v5.addVertexWithUV(p.posX + w, p.posY, 0, du, v);
      v5.addVertexWithUV(p.posX, p.posY, 0, u, v);

      p.move(180D / ReikaRenderHelper.getFPS());

      p.age++;
      if (!ReikaMathLibrary.isValueInsideBounds(posX, posX + xSize - 8, p.posX)
          || !ReikaMathLibrary.isValueInsideBounds(posY, posY + 80, p.posY)) {
        it.remove();
      }
    }

    v5.draw();

    if (rand.nextInt(50) == 0) {
      particles.add(new PylonParticle(245, 40, rand.nextInt(360)));
    }

    BlendMode.DEFAULT.apply();
  }
  public void renderItem(IItemRenderer.ItemRenderType aType, ItemStack aStack, Object... data) {
    if (GT_Utility.isStackInvalid(aStack)) {
      return;
    }
    GT_MetaGenerated_Tool aItem = (GT_MetaGenerated_Tool) aStack.getItem();
    GL11.glEnable(3042);
    if (aType == IItemRenderer.ItemRenderType.ENTITY) {
      if (RenderItem.renderInFrame) {
        GL11.glScalef(0.85F, 0.85F, 0.85F);
        GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
        GL11.glTranslated(-0.5D, -0.42D, 0.0D);
      } else {
        GL11.glTranslated(-0.5D, -0.42D, 0.0D);
      }
    }
    GL11.glColor3f(1.0F, 1.0F, 1.0F);

    IToolStats tToolStats = aItem.getToolStats(aStack);
    if (tToolStats != null) {
      IIconContainer aIcon = tToolStats.getIcon(false, aStack);
      if (aIcon != null) {
        IIcon tIcon = aIcon.getIcon();
        IIcon tOverlay = aIcon.getOverlayIcon();
        if (tIcon != null) {
          Minecraft.getMinecraft().renderEngine.bindTexture(aIcon.getTextureFile());
          GL11.glBlendFunc(770, 771);
          short[] tModulation = tToolStats.getRGBa(false, aStack);
          GL11.glColor3f(tModulation[0] / 255.0F, tModulation[1] / 255.0F, tModulation[2] / 255.0F);
          if (aType.equals(IItemRenderer.ItemRenderType.INVENTORY)) {
            GT_RenderUtil.renderItemIcon(tIcon, 16.0D, 0.001D, 0.0F, 0.0F, -1.0F);
          } else {
            ItemRenderer.renderItemIn2D(
                Tessellator.instance,
                tIcon.getMaxU(),
                tIcon.getMinV(),
                tIcon.getMinU(),
                tIcon.getMaxV(),
                tIcon.getIconWidth(),
                tIcon.getIconHeight(),
                0.0625F);
          }
          GL11.glColor3f(1.0F, 1.0F, 1.0F);
        }
        if (tOverlay != null) {
          Minecraft.getMinecraft().renderEngine.bindTexture(aIcon.getTextureFile());
          GL11.glBlendFunc(770, 771);
          if (aType.equals(IItemRenderer.ItemRenderType.INVENTORY)) {
            GT_RenderUtil.renderItemIcon(tOverlay, 16.0D, 0.001D, 0.0F, 0.0F, -1.0F);
          } else {
            ItemRenderer.renderItemIn2D(
                Tessellator.instance,
                tOverlay.getMaxU(),
                tOverlay.getMinV(),
                tOverlay.getMinU(),
                tOverlay.getMaxV(),
                tOverlay.getIconWidth(),
                tOverlay.getIconHeight(),
                0.0625F);
          }
        }
      }
      aIcon = tToolStats.getIcon(true, aStack);
      if (aIcon != null) {
        IIcon tIcon = aIcon.getIcon();
        IIcon tOverlay = aIcon.getOverlayIcon();
        if (tIcon != null) {
          Minecraft.getMinecraft().renderEngine.bindTexture(aIcon.getTextureFile());
          GL11.glBlendFunc(770, 771);
          short[] tModulation = tToolStats.getRGBa(true, aStack);
          GL11.glColor3f(tModulation[0] / 255.0F, tModulation[1] / 255.0F, tModulation[2] / 255.0F);
          if (aType.equals(IItemRenderer.ItemRenderType.INVENTORY)) {
            GT_RenderUtil.renderItemIcon(tIcon, 16.0D, 0.001D, 0.0F, 0.0F, -1.0F);
          } else {
            ItemRenderer.renderItemIn2D(
                Tessellator.instance,
                tIcon.getMaxU(),
                tIcon.getMinV(),
                tIcon.getMinU(),
                tIcon.getMaxV(),
                tIcon.getIconWidth(),
                tIcon.getIconHeight(),
                0.0625F);
          }
          GL11.glColor3f(1.0F, 1.0F, 1.0F);
        }
        if (tOverlay != null) {
          Minecraft.getMinecraft().renderEngine.bindTexture(aIcon.getTextureFile());
          GL11.glBlendFunc(770, 771);
          if (aType.equals(IItemRenderer.ItemRenderType.INVENTORY)) {
            GT_RenderUtil.renderItemIcon(tOverlay, 16.0D, 0.001D, 0.0F, 0.0F, -1.0F);
          } else {
            ItemRenderer.renderItemIn2D(
                Tessellator.instance,
                tOverlay.getMaxU(),
                tOverlay.getMinV(),
                tOverlay.getMinU(),
                tOverlay.getMaxV(),
                tOverlay.getIconWidth(),
                tOverlay.getIconHeight(),
                0.0625F);
          }
        }
      }
      if ((aType == IItemRenderer.ItemRenderType.INVENTORY)
          && (GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) != Materials._NULL)) {
        long tDamage = GT_MetaGenerated_Tool.getToolDamage(aStack);
        long tMaxDamage = GT_MetaGenerated_Tool.getToolMaxDamage(aStack);
        if (tDamage <= 0L) {
          aIcon = gregtech.api.enums.Textures.ItemIcons.DURABILITY_BAR[8];
        } else if (tDamage >= tMaxDamage) {
          aIcon = gregtech.api.enums.Textures.ItemIcons.DURABILITY_BAR[0];
        } else {
          aIcon =
              gregtech.api.enums.Textures.ItemIcons.DURABILITY_BAR[
                  ((int)
                      java.lang.Math.max(
                          0L, java.lang.Math.min(7L, (tMaxDamage - tDamage) * 8L / tMaxDamage)))];
        }
        if (aIcon != null) {
          IIcon tIcon = aIcon.getIcon();
          IIcon tOverlay = aIcon.getOverlayIcon();
          if (tIcon != null) {
            Minecraft.getMinecraft().renderEngine.bindTexture(aIcon.getTextureFile());
            GL11.glBlendFunc(770, 771);
            if (aType.equals(IItemRenderer.ItemRenderType.INVENTORY)) {
              GT_RenderUtil.renderItemIcon(tIcon, 16.0D, 0.001D, 0.0F, 0.0F, -1.0F);
            } else {
              ItemRenderer.renderItemIn2D(
                  Tessellator.instance,
                  tIcon.getMaxU(),
                  tIcon.getMinV(),
                  tIcon.getMinU(),
                  tIcon.getMaxV(),
                  tIcon.getIconWidth(),
                  tIcon.getIconHeight(),
                  0.0625F);
            }
          }
          if (tOverlay != null) {
            Minecraft.getMinecraft().renderEngine.bindTexture(aIcon.getTextureFile());
            GL11.glBlendFunc(770, 771);
            if (aType.equals(IItemRenderer.ItemRenderType.INVENTORY)) {
              GT_RenderUtil.renderItemIcon(tOverlay, 16.0D, 0.001D, 0.0F, 0.0F, -1.0F);
            } else {
              ItemRenderer.renderItemIn2D(
                  Tessellator.instance,
                  tOverlay.getMaxU(),
                  tOverlay.getMinV(),
                  tOverlay.getMinU(),
                  tOverlay.getMaxV(),
                  tOverlay.getIconWidth(),
                  tOverlay.getIconHeight(),
                  0.0625F);
            }
          }
        }
        Long[] tStats = aItem.getElectricStats(aStack);
        if ((tStats != null) && (tStats[3].longValue() < 0L)) {
          long tCharge = aItem.getRealCharge(aStack);
          if (tCharge <= 0L) {
            aIcon = gregtech.api.enums.Textures.ItemIcons.ENERGY_BAR[0];
          } else if (tCharge >= tStats[0].longValue()) {
            aIcon = gregtech.api.enums.Textures.ItemIcons.ENERGY_BAR[8];
          } else {
            aIcon =
                gregtech.api.enums.Textures.ItemIcons.ENERGY_BAR[
                    (7
                        - (int)
                            java.lang.Math.max(
                                0L,
                                java.lang.Math.min(
                                    6L,
                                    (tStats[0].longValue() - tCharge)
                                        * 7L
                                        / tStats[0].longValue())))];
          }
        } else {
          aIcon = null;
        }
        if (aIcon != null) {
          IIcon tIcon = aIcon.getIcon();
          IIcon tOverlay = aIcon.getOverlayIcon();
          if (tIcon != null) {
            Minecraft.getMinecraft().renderEngine.bindTexture(aIcon.getTextureFile());
            GL11.glBlendFunc(770, 771);
            if (aType.equals(IItemRenderer.ItemRenderType.INVENTORY)) {
              GT_RenderUtil.renderItemIcon(tIcon, 16.0D, 0.001D, 0.0F, 0.0F, -1.0F);
            } else {
              ItemRenderer.renderItemIn2D(
                  Tessellator.instance,
                  tIcon.getMaxU(),
                  tIcon.getMinV(),
                  tIcon.getMinU(),
                  tIcon.getMaxV(),
                  tIcon.getIconWidth(),
                  tIcon.getIconHeight(),
                  0.0625F);
            }
          }
          if (tOverlay != null) {
            Minecraft.getMinecraft().renderEngine.bindTexture(aIcon.getTextureFile());
            GL11.glBlendFunc(770, 771);
            if (aType.equals(IItemRenderer.ItemRenderType.INVENTORY)) {
              GT_RenderUtil.renderItemIcon(tOverlay, 16.0D, 0.001D, 0.0F, 0.0F, -1.0F);
            } else {
              ItemRenderer.renderItemIn2D(
                  Tessellator.instance,
                  tOverlay.getMaxU(),
                  tOverlay.getMinV(),
                  tOverlay.getMinU(),
                  tOverlay.getMaxV(),
                  tOverlay.getIconWidth(),
                  tOverlay.getIconHeight(),
                  0.0625F);
            }
          }
        }
      }
    }
    GL11.glDisable(3042);
  }
Example #26
0
  public void renderItemStack(ItemStack stack) {
    if (stack != null) {
      Minecraft mc = Minecraft.getMinecraft();
      mc.renderEngine.bindTexture(
          stack.getItem() instanceof ItemBlock
              ? TextureMap.locationBlocksTexture
              : TextureMap.locationItemsTexture);

      float s = 0.25F;
      GL11.glScalef(s, s, s);
      GL11.glScalef(2F, 2F, 2F);
      if (!ForgeHooksClient.renderEntityItem(
          new EntityItem(
              brewery.getWorldObj(), brewery.xCoord, brewery.yCoord, brewery.zCoord, stack),
          stack,
          0F,
          0F,
          brewery.getWorldObj().rand,
          mc.renderEngine,
          RenderBlocks.getInstance(),
          1)) {
        GL11.glScalef(0.5F, 0.5F, 0.5F);
        if (stack.getItem() instanceof ItemBlock
            && RenderBlocks.renderItemIn3d(
                Block.getBlockFromItem(stack.getItem()).getRenderType())) {
          GL11.glScalef(0.5F, 0.5F, 0.5F);
          GL11.glTranslatef(1F, 1.1F, 0F);
          GL11.glPushMatrix();
          RenderBlocks.getInstance()
              .renderBlockAsItem(
                  Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 1F);
          GL11.glPopMatrix();
          GL11.glTranslatef(-1F, -1.1F, 0F);
          GL11.glScalef(2F, 2F, 2F);
        } else {
          int renderPass = 0;
          do {
            IIcon icon = stack.getItem().getIcon(stack, renderPass);
            if (icon != null) {
              Color color = new Color(stack.getItem().getColorFromItemStack(stack, renderPass));
              GL11.glColor3ub(
                  (byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue());
              float f = icon.getMinU();
              float f1 = icon.getMaxU();
              float f2 = icon.getMinV();
              float f3 = icon.getMaxV();

              ItemRenderer.renderItemIn2D(
                  Tessellator.instance,
                  f1,
                  f2,
                  f,
                  f3,
                  icon.getIconWidth(),
                  icon.getIconHeight(),
                  1F / 16F);
              GL11.glColor3f(1F, 1F, 1F);
            }
            renderPass++;
          } while (renderPass < stack.getItem().getRenderPasses(stack.getItemDamage()));
        }
      }
      GL11.glScalef(1F / s, 1F / s, 1F / s);

      Minecraft.getMinecraft().renderEngine.bindTexture(texture);
    }
  }
Example #27
0
    void set(double x, double y, double z, IIcon icon, IIcon icon1, IIcon icon2) {
      tessellator = Tessellator.instance;

      i0u0 = icon.getMinU();
      i0uh = icon.getInterpolatedU(8.0D);
      i0u1 = icon.getMaxU();
      i0v0 = icon.getMinV();
      i0v1 = icon.getMaxV();

      i1u0 = icon1.getInterpolatedU(7.0D);
      i1u1 = icon1.getInterpolatedU(9.0D);
      i1v0 = icon1.getMinV();
      i1vh = icon1.getInterpolatedV(8.0D);
      i1v1 = icon1.getMaxV();
      i1v = i1v1 - i1v0;

      i2u0 = icon2.getInterpolatedU(7.0D);
      i2u1 = icon2.getInterpolatedU(9.0D);
      i2v0 = icon2.getMinV();
      i2v1 = icon2.getMaxV();
      i2v = i2v1 - i2v0;

      x0 = x;
      xh = x0 + 0.5D;
      x1 = x + 1;
      xp0 = x0 + 0.5D - 0.0625D;
      xp1 = x0 + 0.5D + 0.0625D;

      z0 = z;
      zh = z0 + 0.5D;
      z1 = z + 1;
      zp0 = z0 + 0.5D - 0.0625D;
      zp1 = z0 + 0.5D + 0.0625D;

      y0 = y;
      y1 = y + 1;
    }
Example #28
0
  public void renderTexturedCuboid(AxisAlignedBB aabb, IIcon icon) {

    Tessellator t = Tessellator.instance;

    if (aabb.minZ != 0 && (!connections[3] || aabb.minZ != 0.75)) {
      if (aabb.maxY == 1 || aabb.minY == 0) {
        double minX = icon.getInterpolatedU(aabb.minX * 16);
        double maxX = icon.getInterpolatedU(aabb.maxX * 16);
        double minY = icon.getInterpolatedV(aabb.minY * 16);
        double maxY = icon.getInterpolatedV(aabb.maxY * 16);
        t.setNormal(0, 0, -1);

        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.minZ, maxX, maxY); // minZ
        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.minZ, minX, maxY);
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.minZ, minX, minY);
        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.minZ, maxX, minY);

        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.minZ, maxX, maxY); // minZ
        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.minZ, maxX, minY);
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.minZ, minX, minY);
        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.minZ, minX, maxY);

      } else {
        double minX = icon.getInterpolatedU(aabb.minY * 16);
        double maxX = icon.getInterpolatedU(aabb.maxY * 16);
        double minY = icon.getInterpolatedV(aabb.minX * 16);
        double maxY = icon.getInterpolatedV(aabb.maxX * 16);
        t.setNormal(0, 0, -1);

        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.minZ, maxX, maxY); // minZ
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.minZ, minX, maxY);
        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.minZ, minX, minY);
        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.minZ, maxX, minY);

        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.minZ, maxX, maxY); // minZ
        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.minZ, maxX, minY);
        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.minZ, minX, minY);
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.minZ, minX, maxY);
      }
    }

    if (aabb.maxZ != 1 && (!connections[2] || aabb.maxZ != 0.25)) {
      if (aabb.minY == 0 || aabb.maxY == 1) {
        double minX = icon.getInterpolatedU(aabb.minX * 16);
        double maxX = icon.getInterpolatedU(aabb.maxX * 16);
        double minY = icon.getInterpolatedV(aabb.minY * 16);
        double maxY = icon.getInterpolatedV(aabb.maxY * 16);
        t.setNormal(0, 0, 1);
        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.maxZ, minX, minY);
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.maxZ, minX, maxY); // maxZ
        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.maxZ, maxX, maxY);
        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.maxZ, maxX, minY);

        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.maxZ, minX, minY);
        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.maxZ, maxX, minY);
        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.maxZ, maxX, maxY);
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.maxZ, minX, maxY); // maxZ

      } else {
        double minX = icon.getInterpolatedU(aabb.minY * 16);
        double maxX = icon.getInterpolatedU(aabb.maxY * 16);
        double minY = icon.getInterpolatedV(aabb.minX * 16);
        double maxY = icon.getInterpolatedV(aabb.maxX * 16);
        t.setNormal(0, 0, 1);
        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.maxZ, minX, minY);
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.maxZ, minX, maxY); // maxZ
        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.maxZ, maxX, maxY);
        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.maxZ, maxX, minY);

        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.maxZ, minX, minY);
        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.maxZ, maxX, minY);
        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.maxZ, maxX, maxY);
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.maxZ, minX, maxY); // maxZ
      }
    }

    if (aabb.minY != 0 && (!connections[1] || aabb.minY != 0.75)) {
      if (aabb.minX == 0 || aabb.maxX == 1) {
        double minX = icon.getInterpolatedU(aabb.minZ * 16);
        double maxX = icon.getInterpolatedU(aabb.maxZ * 16);
        double minZ = icon.getInterpolatedV(aabb.minX * 16);
        double maxZ = icon.getInterpolatedV(aabb.maxX * 16);
        t.setNormal(0, -1, 0);
        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.minZ, minX, maxZ); // bottom
        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.maxZ, maxX, maxZ);
        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.maxZ, maxX, minZ);
        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.minZ, minX, minZ);

        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.minZ, minX, maxZ); // bottom
        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.minZ, minX, minZ);
        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.maxZ, maxX, minZ);
        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.maxZ, maxX, maxZ);
      } else {
        double minX = icon.getInterpolatedU(aabb.minX * 16);
        double maxX = icon.getInterpolatedU(aabb.maxX * 16);
        double minZ = icon.getInterpolatedV(aabb.minZ * 16);
        double maxZ = icon.getInterpolatedV(aabb.maxZ * 16);
        t.setNormal(0, -1, 0);
        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.maxZ, minX, maxZ); // bottom
        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.maxZ, maxX, maxZ);
        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.minZ, maxX, minZ);
        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.minZ, minX, minZ);

        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.maxZ, minX, maxZ); // bottom
        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.minZ, minX, minZ);
        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.minZ, maxX, minZ);
        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.maxZ, maxX, maxZ);
      }
    }

    if (aabb.maxY != 1 && (!connections[0] || aabb.maxY != 0.25)) {
      if (aabb.minX == 0 || aabb.maxX == 1) {
        double minX = icon.getInterpolatedU(aabb.minZ * 16);
        double maxX = icon.getInterpolatedU(aabb.maxZ * 16);
        double minZ = icon.getInterpolatedV(aabb.minX * 16);
        double maxZ = icon.getInterpolatedV(aabb.maxX * 16);
        t.setNormal(0, 1, 0);
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.minZ, minX, minZ); // top
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.maxZ, maxX, minZ);
        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.maxZ, maxX, maxZ);
        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.minZ, minX, maxZ);

        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.minZ, minX, minZ); // top
        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.minZ, minX, maxZ);
        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.maxZ, maxX, maxZ);
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.maxZ, maxX, minZ);
      } else {
        double minX = icon.getInterpolatedU(aabb.minX * 16);
        double maxX = icon.getInterpolatedU(aabb.maxX * 16);
        double minZ = icon.getInterpolatedV(aabb.minZ * 16);
        double maxZ = icon.getInterpolatedV(aabb.maxZ * 16);
        t.setNormal(0, 1, 0);
        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.maxZ, minX, minZ); // top
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.maxZ, maxX, minZ);
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.minZ, maxX, maxZ);
        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.minZ, minX, maxZ);

        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.maxZ, minX, minZ); // top
        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.minZ, minX, maxZ);
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.minZ, maxX, maxZ);
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.maxZ, maxX, minZ);
      }
    }

    if (aabb.minX != 0 && (!connections[5] || aabb.minX != 0.75)) {
      if (aabb.minY == 0 || aabb.maxY == 1) {
        double minY = icon.getInterpolatedU(aabb.minZ * 16);
        double maxY = icon.getInterpolatedU(aabb.maxZ * 16);
        double minZ = icon.getInterpolatedV(aabb.minY * 16);
        double maxZ = icon.getInterpolatedV(aabb.maxY * 16);

        t.setNormal(-1, 0, 0);
        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.minZ, minY, minZ); // minX
        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.minZ, minY, maxZ);
        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.maxZ, maxY, maxZ);
        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.maxZ, maxY, minZ);

        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.minZ, minY, minZ); // minX
        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.maxZ, maxY, minZ);
        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.maxZ, maxY, maxZ);
        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.minZ, minY, maxZ);
      } else {
        double minY = icon.getInterpolatedU(aabb.minY * 16);
        double maxY = icon.getInterpolatedU(aabb.maxY * 16);
        double minZ = icon.getInterpolatedV(aabb.minZ * 16);
        double maxZ = icon.getInterpolatedV(aabb.maxZ * 16);

        t.setNormal(-1, 0, 0);
        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.minZ, minY, minZ); // minX
        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.maxZ, minY, maxZ);
        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.maxZ, maxY, maxZ);
        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.minZ, maxY, minZ);

        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.minZ, minY, minZ); // minX
        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.minZ, maxY, minZ);
        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.maxZ, maxY, maxZ);
        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.maxZ, minY, maxZ);
      }
    }

    if (aabb.maxX != 1 && (!connections[4] || aabb.maxX != 0.25)) {
      if (aabb.minY == 0 || aabb.maxY == 1) {

        double minY = icon.getInterpolatedU(aabb.minZ * 16);
        double maxY = icon.getInterpolatedU(aabb.maxZ * 16);
        double minZ = icon.getInterpolatedV(aabb.minY * 16);
        double maxZ = icon.getInterpolatedV(aabb.maxY * 16);
        t.setNormal(1, 0, 0);
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.minZ, minY, maxZ); // maxX
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.maxZ, maxY, maxZ);
        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.maxZ, maxY, minZ);
        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.minZ, minY, minZ);

        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.minZ, minY, maxZ); // maxX
        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.minZ, minY, minZ);
        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.maxZ, maxY, minZ);
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.maxZ, maxY, maxZ);
      } else {
        double minY = icon.getInterpolatedU(aabb.minY * 16);
        double maxY = icon.getInterpolatedU(aabb.maxY * 16);
        double minZ = icon.getInterpolatedV(aabb.minZ * 16);
        double maxZ = icon.getInterpolatedV(aabb.maxZ * 16);
        t.setNormal(1, 0, 0);
        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.maxZ, minY, maxZ); // maxX
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.maxZ, maxY, maxZ);
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.minZ, maxY, minZ);
        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.minZ, minY, minZ);

        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.maxZ, minY, maxZ); // maxX
        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.minZ, minY, minZ);
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.minZ, maxY, minZ);
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.maxZ, maxY, maxZ);
      }
    }
  }
Example #29
0
  private void renderMiddle(AxisAlignedBB aabb, IIcon icon) {

    Tessellator t = Tessellator.instance;

    if (!connections[2]) {
      double minX = icon.getInterpolatedU(aabb.minX * 16);
      double maxX = icon.getInterpolatedU(aabb.maxX * 16);
      double minY = icon.getInterpolatedV(aabb.minY * 16);
      double maxY = icon.getInterpolatedV(aabb.maxY * 16);

      t.setNormal(0, 0, -1);
      if (connections[4]) { // or 5
        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.minZ, minX, maxY); // minZ
        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.minZ, minX, minY);
        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.minZ, maxX, minY);
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.minZ, maxX, maxY);

        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.minZ, minX, maxY); // minZ
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.minZ, maxX, maxY);
        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.minZ, maxX, minY);
        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.minZ, minX, minY);
      } else {
        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.minZ, minX, maxY); // minZ
        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.minZ, maxX, maxY);
        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.minZ, maxX, minY);
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.minZ, minX, minY);

        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.minZ, minX, maxY); // minZ
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.minZ, minX, minY);
        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.minZ, maxX, minY);
        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.minZ, maxX, maxY);
      }
    }

    if (!connections[3]) {
      double minX = icon.getInterpolatedU(aabb.minX * 16);
      double maxX = icon.getInterpolatedU(aabb.maxX * 16);
      double minY = icon.getInterpolatedV(aabb.minY * 16);
      double maxY = icon.getInterpolatedV(aabb.maxY * 16);
      t.setNormal(0, 0, 1);
      if (connections[4]) { // or 5
        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.maxZ, maxX, maxY);
        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.maxZ, minX, maxY); // maxZ
        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.maxZ, minX, minY);
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.maxZ, maxX, minY);

        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.maxZ, maxX, maxY);
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.maxZ, maxX, minY);
        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.maxZ, minX, minY);
        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.maxZ, minX, maxY); // maxZ
      } else {
        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.maxZ, minX, minY);
        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.maxZ, minX, maxY); // maxZ
        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.maxZ, maxX, maxY);
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.maxZ, maxX, minY);

        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.maxZ, minX, minY);
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.maxZ, maxX, minY);
        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.maxZ, maxX, maxY);
        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.maxZ, minX, maxY); // maxZ
      }
    }

    if (!connections[0]) {
      double minX = icon.getInterpolatedU(aabb.minX * 16);
      double maxX = icon.getInterpolatedU(aabb.maxX * 16);
      double minZ = icon.getInterpolatedV(aabb.minZ * 16);
      double maxZ = icon.getInterpolatedV(aabb.maxZ * 16);
      t.setNormal(0, -1, 0);
      if (connections[4]) { // or 5
        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.minZ, maxX, maxZ); // bottom
        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.maxZ, minX, maxZ);
        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.maxZ, minX, minZ);
        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.minZ, maxX, minZ);

        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.minZ, maxX, maxZ); // bottom
        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.minZ, maxX, minZ);
        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.maxZ, minX, minZ);
        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.maxZ, minX, maxZ);
      } else {
        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.minZ, maxX, maxZ); // bottom
        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.minZ, minX, maxZ);
        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.maxZ, minX, minZ);
        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.maxZ, maxX, minZ);

        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.minZ, maxX, maxZ); // bottom
        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.maxZ, maxX, minZ);
        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.maxZ, minX, minZ);
        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.minZ, minX, maxZ);
      }
    }

    if (!connections[1]) {
      double minX = icon.getInterpolatedU(aabb.minX * 16);
      double maxX = icon.getInterpolatedU(aabb.maxX * 16);
      double minZ = icon.getInterpolatedV(aabb.minZ * 16);
      double maxZ = icon.getInterpolatedV(aabb.maxZ * 16);
      t.setNormal(0, 1, 0);
      if (connections[4]) { // or 5
        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.minZ, maxX, maxZ); // top
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.minZ, maxX, minZ);
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.maxZ, minX, minZ);
        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.maxZ, minX, maxZ);

        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.minZ, maxX, maxZ); // top
        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.maxZ, minX, maxZ);
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.maxZ, minX, minZ);
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.minZ, maxX, minZ);
      } else {
        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.minZ, maxX, minZ); // top
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.minZ, minX, minZ);
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.maxZ, minX, maxZ);
        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.maxZ, maxX, maxZ);

        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.minZ, maxX, minZ); // top
        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.maxZ, maxX, maxZ);
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.maxZ, minX, maxZ);
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.minZ, minX, minZ);
      }
    }

    if (!connections[4]) {
      double minY = icon.getInterpolatedU(aabb.minY * 16);
      double maxY = icon.getInterpolatedU(aabb.maxY * 16);
      double minZ = icon.getInterpolatedV(aabb.minZ * 16);
      double maxZ = icon.getInterpolatedV(aabb.maxZ * 16);
      t.setNormal(-1, 0, 0);
      if (connections[0]) {
        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.minZ, maxY, maxZ); // minX
        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.maxZ, minY, maxZ);
        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.maxX, minY, minZ);
        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.minZ, maxY, minZ);

        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.minZ, maxY, maxZ); // minX
        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.minZ, maxY, minZ);
        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.maxX, minY, minZ);
        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.maxZ, minY, maxZ);
      } else {
        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.minZ, minY, minZ); // minX
        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.minZ, maxY, minZ);
        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.maxX, maxY, maxZ);
        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.maxZ, minY, maxZ);

        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.minZ, minY, minZ); // minX
        t.addVertexWithUV(aabb.minX, aabb.minY, aabb.maxZ, minY, maxZ);
        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.maxX, maxY, maxZ);
        t.addVertexWithUV(aabb.minX, aabb.maxY, aabb.minZ, maxY, minZ);
      }
    }

    if (!connections[5]) {
      double minY = icon.getInterpolatedU(aabb.minY * 16);
      double maxY = icon.getInterpolatedU(aabb.maxY * 16);
      double minZ = icon.getInterpolatedV(aabb.minZ * 16);
      double maxZ = icon.getInterpolatedV(aabb.maxZ * 16);
      t.setNormal(1, 0, 0);
      if (connections[0]) {
        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.minZ, minY, maxZ); // maxX
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.minZ, minY, minZ);
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.maxZ, maxY, minZ);
        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.maxZ, maxY, maxZ);

        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.minZ, minY, maxZ); // maxX
        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.maxZ, maxY, maxZ);
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.maxZ, maxY, minZ);
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.minZ, minY, minZ);
      } else {
        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.minZ, minY, maxZ); // maxX
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.minZ, maxY, maxZ);
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.maxZ, maxY, minZ);
        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.maxZ, minY, minZ);

        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.minZ, minY, maxZ); // maxX
        t.addVertexWithUV(aabb.maxX, aabb.minY, aabb.maxZ, minY, minZ);
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.maxZ, maxY, minZ);
        t.addVertexWithUV(aabb.maxX, aabb.maxY, aabb.minZ, maxY, maxZ);
      }
    }
  }
  public boolean renderGreekFire(
      IBlockAccess blockAccess,
      BlockGreekFire block,
      int p_147801_2_,
      int p_147801_3_,
      int p_147801_4_) {
    Tessellator tessellator = Tessellator.instance;
    IIcon iicon = block.getFireIcon(0);
    IIcon iicon1 = block.getFireIcon(1);
    IIcon iicon2 = iicon;

    tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F);
    tessellator.setBrightness(
        block.getMixedBrightnessForBlock(blockAccess, p_147801_2_, p_147801_3_, p_147801_4_));
    double d0 = (double) iicon2.getMinU();
    double d1 = (double) iicon2.getMinV();
    double d2 = (double) iicon2.getMaxU();
    double d3 = (double) iicon2.getMaxV();
    float f = 1.4F;
    double d5;
    double d6;
    double d7;
    double d8;
    double d9;
    double d10;
    double d11;

    if (!World.doesBlockHaveSolidTopSurface(blockAccess, p_147801_2_, p_147801_3_ - 1, p_147801_4_)
        && !block.canCatchFire(blockAccess, p_147801_2_, p_147801_3_ - 1, p_147801_4_, UP)) {
      float f2 = 0.2F;
      float f1 = 0.0625F;
      boolean sides = false;

      if ((p_147801_2_ + p_147801_3_ + p_147801_4_ & 1) == 1) {
        d0 = (double) iicon1.getMinU();
        d1 = (double) iicon1.getMinV();
        d2 = (double) iicon1.getMaxU();
        d3 = (double) iicon1.getMaxV();
      }

      if ((p_147801_2_ / 2 + p_147801_3_ / 2 + p_147801_4_ / 2 & 1) == 1) {
        d5 = d2;
        d2 = d0;
        d0 = d5;
      }

      if (block.canCatchFire(blockAccess, p_147801_2_ - 1, p_147801_3_, p_147801_4_, EAST)) {
        sides = true;
        tessellator.addVertexWithUV(
            (double) ((float) p_147801_2_ + f2),
            (double) ((float) p_147801_3_ + f + f1),
            (double) (p_147801_4_ + 1),
            d2,
            d1);
        tessellator.addVertexWithUV(
            (double) (p_147801_2_ + 0),
            (double) ((float) (p_147801_3_ + 0) + f1),
            (double) (p_147801_4_ + 1),
            d2,
            d3);
        tessellator.addVertexWithUV(
            (double) (p_147801_2_ + 0),
            (double) ((float) (p_147801_3_ + 0) + f1),
            (double) (p_147801_4_ + 0),
            d0,
            d3);
        tessellator.addVertexWithUV(
            (double) ((float) p_147801_2_ + f2),
            (double) ((float) p_147801_3_ + f + f1),
            (double) (p_147801_4_ + 0),
            d0,
            d1);
        tessellator.addVertexWithUV(
            (double) ((float) p_147801_2_ + f2),
            (double) ((float) p_147801_3_ + f + f1),
            (double) (p_147801_4_ + 0),
            d0,
            d1);
        tessellator.addVertexWithUV(
            (double) (p_147801_2_ + 0),
            (double) ((float) (p_147801_3_ + 0) + f1),
            (double) (p_147801_4_ + 0),
            d0,
            d3);
        tessellator.addVertexWithUV(
            (double) (p_147801_2_ + 0),
            (double) ((float) (p_147801_3_ + 0) + f1),
            (double) (p_147801_4_ + 1),
            d2,
            d3);
        tessellator.addVertexWithUV(
            (double) ((float) p_147801_2_ + f2),
            (double) ((float) p_147801_3_ + f + f1),
            (double) (p_147801_4_ + 1),
            d2,
            d1);
      }

      if (block.canCatchFire(blockAccess, p_147801_2_ + 1, p_147801_3_, p_147801_4_, WEST)) {
        sides = true;
        tessellator.addVertexWithUV(
            (double) ((float) (p_147801_2_ + 1) - f2),
            (double) ((float) p_147801_3_ + f + f1),
            (double) (p_147801_4_ + 0),
            d0,
            d1);
        tessellator.addVertexWithUV(
            (double) (p_147801_2_ + 1 - 0),
            (double) ((float) (p_147801_3_ + 0) + f1),
            (double) (p_147801_4_ + 0),
            d0,
            d3);
        tessellator.addVertexWithUV(
            (double) (p_147801_2_ + 1 - 0),
            (double) ((float) (p_147801_3_ + 0) + f1),
            (double) (p_147801_4_ + 1),
            d2,
            d3);
        tessellator.addVertexWithUV(
            (double) ((float) (p_147801_2_ + 1) - f2),
            (double) ((float) p_147801_3_ + f + f1),
            (double) (p_147801_4_ + 1),
            d2,
            d1);
        tessellator.addVertexWithUV(
            (double) ((float) (p_147801_2_ + 1) - f2),
            (double) ((float) p_147801_3_ + f + f1),
            (double) (p_147801_4_ + 1),
            d2,
            d1);
        tessellator.addVertexWithUV(
            (double) (p_147801_2_ + 1 - 0),
            (double) ((float) (p_147801_3_ + 0) + f1),
            (double) (p_147801_4_ + 1),
            d2,
            d3);
        tessellator.addVertexWithUV(
            (double) (p_147801_2_ + 1 - 0),
            (double) ((float) (p_147801_3_ + 0) + f1),
            (double) (p_147801_4_ + 0),
            d0,
            d3);
        tessellator.addVertexWithUV(
            (double) ((float) (p_147801_2_ + 1) - f2),
            (double) ((float) p_147801_3_ + f + f1),
            (double) (p_147801_4_ + 0),
            d0,
            d1);
      }

      if (block.canCatchFire(blockAccess, p_147801_2_, p_147801_3_, p_147801_4_ - 1, SOUTH)) {
        sides = true;
        tessellator.addVertexWithUV(
            (double) (p_147801_2_ + 0),
            (double) ((float) p_147801_3_ + f + f1),
            (double) ((float) p_147801_4_ + f2),
            d2,
            d1);
        tessellator.addVertexWithUV(
            (double) (p_147801_2_ + 0),
            (double) ((float) (p_147801_3_ + 0) + f1),
            (double) (p_147801_4_ + 0),
            d2,
            d3);
        tessellator.addVertexWithUV(
            (double) (p_147801_2_ + 1),
            (double) ((float) (p_147801_3_ + 0) + f1),
            (double) (p_147801_4_ + 0),
            d0,
            d3);
        tessellator.addVertexWithUV(
            (double) (p_147801_2_ + 1),
            (double) ((float) p_147801_3_ + f + f1),
            (double) ((float) p_147801_4_ + f2),
            d0,
            d1);
        tessellator.addVertexWithUV(
            (double) (p_147801_2_ + 1),
            (double) ((float) p_147801_3_ + f + f1),
            (double) ((float) p_147801_4_ + f2),
            d0,
            d1);
        tessellator.addVertexWithUV(
            (double) (p_147801_2_ + 1),
            (double) ((float) (p_147801_3_ + 0) + f1),
            (double) (p_147801_4_ + 0),
            d0,
            d3);
        tessellator.addVertexWithUV(
            (double) (p_147801_2_ + 0),
            (double) ((float) (p_147801_3_ + 0) + f1),
            (double) (p_147801_4_ + 0),
            d2,
            d3);
        tessellator.addVertexWithUV(
            (double) (p_147801_2_ + 0),
            (double) ((float) p_147801_3_ + f + f1),
            (double) ((float) p_147801_4_ + f2),
            d2,
            d1);
      }

      if (block.canCatchFire(blockAccess, p_147801_2_, p_147801_3_, p_147801_4_ + 1, NORTH)) {
        sides = true;
        tessellator.addVertexWithUV(
            (double) (p_147801_2_ + 1),
            (double) ((float) p_147801_3_ + f + f1),
            (double) ((float) (p_147801_4_ + 1) - f2),
            d0,
            d1);
        tessellator.addVertexWithUV(
            (double) (p_147801_2_ + 1),
            (double) ((float) (p_147801_3_ + 0) + f1),
            (double) (p_147801_4_ + 1 - 0),
            d0,
            d3);
        tessellator.addVertexWithUV(
            (double) (p_147801_2_ + 0),
            (double) ((float) (p_147801_3_ + 0) + f1),
            (double) (p_147801_4_ + 1 - 0),
            d2,
            d3);
        tessellator.addVertexWithUV(
            (double) (p_147801_2_ + 0),
            (double) ((float) p_147801_3_ + f + f1),
            (double) ((float) (p_147801_4_ + 1) - f2),
            d2,
            d1);
        tessellator.addVertexWithUV(
            (double) (p_147801_2_ + 0),
            (double) ((float) p_147801_3_ + f + f1),
            (double) ((float) (p_147801_4_ + 1) - f2),
            d2,
            d1);
        tessellator.addVertexWithUV(
            (double) (p_147801_2_ + 0),
            (double) ((float) (p_147801_3_ + 0) + f1),
            (double) (p_147801_4_ + 1 - 0),
            d2,
            d3);
        tessellator.addVertexWithUV(
            (double) (p_147801_2_ + 1),
            (double) ((float) (p_147801_3_ + 0) + f1),
            (double) (p_147801_4_ + 1 - 0),
            d0,
            d3);
        tessellator.addVertexWithUV(
            (double) (p_147801_2_ + 1),
            (double) ((float) p_147801_3_ + f + f1),
            (double) ((float) (p_147801_4_ + 1) - f2),
            d0,
            d1);
      }

      if (block.canCatchFire(blockAccess, p_147801_2_, p_147801_3_ + 1, p_147801_4_, DOWN)) {
        sides = true;
        d5 = (double) p_147801_2_ + 0.5D + 0.5D;
        d6 = (double) p_147801_2_ + 0.5D - 0.5D;
        d7 = (double) p_147801_4_ + 0.5D + 0.5D;
        d8 = (double) p_147801_4_ + 0.5D - 0.5D;
        d9 = (double) p_147801_2_ + 0.5D - 0.5D;
        d10 = (double) p_147801_2_ + 0.5D + 0.5D;
        d11 = (double) p_147801_4_ + 0.5D - 0.5D;
        double d12 = (double) p_147801_4_ + 0.5D + 0.5D;
        d0 = (double) iicon.getMinU();
        d1 = (double) iicon.getMinV();
        d2 = (double) iicon.getMaxU();
        d3 = (double) iicon.getMaxV();
        ++p_147801_3_;
        f = -0.2F;

        if ((p_147801_2_ + p_147801_3_ + p_147801_4_ & 1) == 0) {
          tessellator.addVertexWithUV(
              d9, (double) ((float) p_147801_3_ + f), (double) (p_147801_4_ + 0), d2, d1);
          tessellator.addVertexWithUV(
              d5, (double) (p_147801_3_ + 0), (double) (p_147801_4_ + 0), d2, d3);
          tessellator.addVertexWithUV(
              d5, (double) (p_147801_3_ + 0), (double) (p_147801_4_ + 1), d0, d3);
          tessellator.addVertexWithUV(
              d9, (double) ((float) p_147801_3_ + f), (double) (p_147801_4_ + 1), d0, d1);
          d0 = (double) iicon1.getMinU();
          d1 = (double) iicon1.getMinV();
          d2 = (double) iicon1.getMaxU();
          d3 = (double) iicon1.getMaxV();
          tessellator.addVertexWithUV(
              d10, (double) ((float) p_147801_3_ + f), (double) (p_147801_4_ + 1), d2, d1);
          tessellator.addVertexWithUV(
              d6, (double) (p_147801_3_ + 0), (double) (p_147801_4_ + 1), d2, d3);
          tessellator.addVertexWithUV(
              d6, (double) (p_147801_3_ + 0), (double) (p_147801_4_ + 0), d0, d3);
          tessellator.addVertexWithUV(
              d10, (double) ((float) p_147801_3_ + f), (double) (p_147801_4_ + 0), d0, d1);
        } else {
          tessellator.addVertexWithUV(
              (double) (p_147801_2_ + 0), (double) ((float) p_147801_3_ + f), d12, d2, d1);
          tessellator.addVertexWithUV(
              (double) (p_147801_2_ + 0), (double) (p_147801_3_ + 0), d8, d2, d3);
          tessellator.addVertexWithUV(
              (double) (p_147801_2_ + 1), (double) (p_147801_3_ + 0), d8, d0, d3);
          tessellator.addVertexWithUV(
              (double) (p_147801_2_ + 1), (double) ((float) p_147801_3_ + f), d12, d0, d1);
          d0 = (double) iicon1.getMinU();
          d1 = (double) iicon1.getMinV();
          d2 = (double) iicon1.getMaxU();
          d3 = (double) iicon1.getMaxV();
          tessellator.addVertexWithUV(
              (double) (p_147801_2_ + 1), (double) ((float) p_147801_3_ + f), d11, d2, d1);
          tessellator.addVertexWithUV(
              (double) (p_147801_2_ + 1), (double) (p_147801_3_ + 0), d7, d2, d3);
          tessellator.addVertexWithUV(
              (double) (p_147801_2_ + 0), (double) (p_147801_3_ + 0), d7, d0, d3);
          tessellator.addVertexWithUV(
              (double) (p_147801_2_ + 0), (double) ((float) p_147801_3_ + f), d11, d0, d1);
        }
      }
      if (!sides) {
        double d4 = (double) p_147801_2_ + 0.5D + 0.2D;
        d5 = (double) p_147801_2_ + 0.5D - 0.2D;
        d6 = (double) p_147801_4_ + 0.5D + 0.2D;
        d7 = (double) p_147801_4_ + 0.5D - 0.2D;
        d8 = (double) p_147801_2_ + 0.5D - 0.3D;
        d9 = (double) p_147801_2_ + 0.5D + 0.3D;
        d10 = (double) p_147801_4_ + 0.5D - 0.3D;
        d11 = (double) p_147801_4_ + 0.5D + 0.3D;
        tessellator.addVertexWithUV(
            d8, (double) ((float) p_147801_3_ + f), (double) (p_147801_4_ + 1), d2, d1);
        tessellator.addVertexWithUV(
            d4, (double) (p_147801_3_ + 0), (double) (p_147801_4_ + 1), d2, d3);
        tessellator.addVertexWithUV(
            d4, (double) (p_147801_3_ + 0), (double) (p_147801_4_ + 0), d0, d3);
        tessellator.addVertexWithUV(
            d8, (double) ((float) p_147801_3_ + f), (double) (p_147801_4_ + 0), d0, d1);
        tessellator.addVertexWithUV(
            d9, (double) ((float) p_147801_3_ + f), (double) (p_147801_4_ + 0), d2, d1);
        tessellator.addVertexWithUV(
            d5, (double) (p_147801_3_ + 0), (double) (p_147801_4_ + 0), d2, d3);
        tessellator.addVertexWithUV(
            d5, (double) (p_147801_3_ + 0), (double) (p_147801_4_ + 1), d0, d3);
        tessellator.addVertexWithUV(
            d9, (double) ((float) p_147801_3_ + f), (double) (p_147801_4_ + 1), d0, d1);
        d0 = (double) iicon1.getMinU();
        d1 = (double) iicon1.getMinV();
        d2 = (double) iicon1.getMaxU();
        d3 = (double) iicon1.getMaxV();
        tessellator.addVertexWithUV(
            (double) (p_147801_2_ + 1), (double) ((float) p_147801_3_ + f), d11, d2, d1);
        tessellator.addVertexWithUV(
            (double) (p_147801_2_ + 1), (double) (p_147801_3_ + 0), d7, d2, d3);
        tessellator.addVertexWithUV(
            (double) (p_147801_2_ + 0), (double) (p_147801_3_ + 0), d7, d0, d3);
        tessellator.addVertexWithUV(
            (double) (p_147801_2_ + 0), (double) ((float) p_147801_3_ + f), d11, d0, d1);
        tessellator.addVertexWithUV(
            (double) (p_147801_2_ + 0), (double) ((float) p_147801_3_ + f), d10, d2, d1);
        tessellator.addVertexWithUV(
            (double) (p_147801_2_ + 0), (double) (p_147801_3_ + 0), d6, d2, d3);
        tessellator.addVertexWithUV(
            (double) (p_147801_2_ + 1), (double) (p_147801_3_ + 0), d6, d0, d3);
        tessellator.addVertexWithUV(
            (double) (p_147801_2_ + 1), (double) ((float) p_147801_3_ + f), d10, d0, d1);
        d4 = (double) p_147801_2_ + 0.5D - 0.5D;
        d5 = (double) p_147801_2_ + 0.5D + 0.5D;
        d6 = (double) p_147801_4_ + 0.5D - 0.5D;
        d7 = (double) p_147801_4_ + 0.5D + 0.5D;
        d8 = (double) p_147801_2_ + 0.5D - 0.4D;
        d9 = (double) p_147801_2_ + 0.5D + 0.4D;
        d10 = (double) p_147801_4_ + 0.5D - 0.4D;
        d11 = (double) p_147801_4_ + 0.5D + 0.4D;
        tessellator.addVertexWithUV(
            d8, (double) ((float) p_147801_3_ + f), (double) (p_147801_4_ + 0), d0, d1);
        tessellator.addVertexWithUV(
            d4, (double) (p_147801_3_ + 0), (double) (p_147801_4_ + 0), d0, d3);
        tessellator.addVertexWithUV(
            d4, (double) (p_147801_3_ + 0), (double) (p_147801_4_ + 1), d2, d3);
        tessellator.addVertexWithUV(
            d8, (double) ((float) p_147801_3_ + f), (double) (p_147801_4_ + 1), d2, d1);
        tessellator.addVertexWithUV(
            d9, (double) ((float) p_147801_3_ + f), (double) (p_147801_4_ + 1), d0, d1);
        tessellator.addVertexWithUV(
            d5, (double) (p_147801_3_ + 0), (double) (p_147801_4_ + 1), d0, d3);
        tessellator.addVertexWithUV(
            d5, (double) (p_147801_3_ + 0), (double) (p_147801_4_ + 0), d2, d3);
        tessellator.addVertexWithUV(
            d9, (double) ((float) p_147801_3_ + f), (double) (p_147801_4_ + 0), d2, d1);
        d0 = (double) iicon.getMinU();
        d1 = (double) iicon.getMinV();
        d2 = (double) iicon.getMaxU();
        d3 = (double) iicon.getMaxV();
        tessellator.addVertexWithUV(
            (double) (p_147801_2_ + 0), (double) ((float) p_147801_3_ + f), d11, d0, d1);
        tessellator.addVertexWithUV(
            (double) (p_147801_2_ + 0), (double) (p_147801_3_ + 0), d7, d0, d3);
        tessellator.addVertexWithUV(
            (double) (p_147801_2_ + 1), (double) (p_147801_3_ + 0), d7, d2, d3);
        tessellator.addVertexWithUV(
            (double) (p_147801_2_ + 1), (double) ((float) p_147801_3_ + f), d11, d2, d1);
        tessellator.addVertexWithUV(
            (double) (p_147801_2_ + 1), (double) ((float) p_147801_3_ + f), d10, d0, d1);
        tessellator.addVertexWithUV(
            (double) (p_147801_2_ + 1), (double) (p_147801_3_ + 0), d6, d0, d3);
        tessellator.addVertexWithUV(
            (double) (p_147801_2_ + 0), (double) (p_147801_3_ + 0), d6, d2, d3);
        tessellator.addVertexWithUV(
            (double) (p_147801_2_ + 0), (double) ((float) p_147801_3_ + f), d10, d2, d1);
      }
    } else {
      double d4 = (double) p_147801_2_ + 0.5D + 0.2D;
      d5 = (double) p_147801_2_ + 0.5D - 0.2D;
      d6 = (double) p_147801_4_ + 0.5D + 0.2D;
      d7 = (double) p_147801_4_ + 0.5D - 0.2D;
      d8 = (double) p_147801_2_ + 0.5D - 0.3D;
      d9 = (double) p_147801_2_ + 0.5D + 0.3D;
      d10 = (double) p_147801_4_ + 0.5D - 0.3D;
      d11 = (double) p_147801_4_ + 0.5D + 0.3D;
      tessellator.addVertexWithUV(
          d8, (double) ((float) p_147801_3_ + f), (double) (p_147801_4_ + 1), d2, d1);
      tessellator.addVertexWithUV(
          d4, (double) (p_147801_3_ + 0), (double) (p_147801_4_ + 1), d2, d3);
      tessellator.addVertexWithUV(
          d4, (double) (p_147801_3_ + 0), (double) (p_147801_4_ + 0), d0, d3);
      tessellator.addVertexWithUV(
          d8, (double) ((float) p_147801_3_ + f), (double) (p_147801_4_ + 0), d0, d1);
      tessellator.addVertexWithUV(
          d9, (double) ((float) p_147801_3_ + f), (double) (p_147801_4_ + 0), d2, d1);
      tessellator.addVertexWithUV(
          d5, (double) (p_147801_3_ + 0), (double) (p_147801_4_ + 0), d2, d3);
      tessellator.addVertexWithUV(
          d5, (double) (p_147801_3_ + 0), (double) (p_147801_4_ + 1), d0, d3);
      tessellator.addVertexWithUV(
          d9, (double) ((float) p_147801_3_ + f), (double) (p_147801_4_ + 1), d0, d1);
      d0 = (double) iicon1.getMinU();
      d1 = (double) iicon1.getMinV();
      d2 = (double) iicon1.getMaxU();
      d3 = (double) iicon1.getMaxV();
      tessellator.addVertexWithUV(
          (double) (p_147801_2_ + 1), (double) ((float) p_147801_3_ + f), d11, d2, d1);
      tessellator.addVertexWithUV(
          (double) (p_147801_2_ + 1), (double) (p_147801_3_ + 0), d7, d2, d3);
      tessellator.addVertexWithUV(
          (double) (p_147801_2_ + 0), (double) (p_147801_3_ + 0), d7, d0, d3);
      tessellator.addVertexWithUV(
          (double) (p_147801_2_ + 0), (double) ((float) p_147801_3_ + f), d11, d0, d1);
      tessellator.addVertexWithUV(
          (double) (p_147801_2_ + 0), (double) ((float) p_147801_3_ + f), d10, d2, d1);
      tessellator.addVertexWithUV(
          (double) (p_147801_2_ + 0), (double) (p_147801_3_ + 0), d6, d2, d3);
      tessellator.addVertexWithUV(
          (double) (p_147801_2_ + 1), (double) (p_147801_3_ + 0), d6, d0, d3);
      tessellator.addVertexWithUV(
          (double) (p_147801_2_ + 1), (double) ((float) p_147801_3_ + f), d10, d0, d1);
      d4 = (double) p_147801_2_ + 0.5D - 0.5D;
      d5 = (double) p_147801_2_ + 0.5D + 0.5D;
      d6 = (double) p_147801_4_ + 0.5D - 0.5D;
      d7 = (double) p_147801_4_ + 0.5D + 0.5D;
      d8 = (double) p_147801_2_ + 0.5D - 0.4D;
      d9 = (double) p_147801_2_ + 0.5D + 0.4D;
      d10 = (double) p_147801_4_ + 0.5D - 0.4D;
      d11 = (double) p_147801_4_ + 0.5D + 0.4D;
      tessellator.addVertexWithUV(
          d8, (double) ((float) p_147801_3_ + f), (double) (p_147801_4_ + 0), d0, d1);
      tessellator.addVertexWithUV(
          d4, (double) (p_147801_3_ + 0), (double) (p_147801_4_ + 0), d0, d3);
      tessellator.addVertexWithUV(
          d4, (double) (p_147801_3_ + 0), (double) (p_147801_4_ + 1), d2, d3);
      tessellator.addVertexWithUV(
          d8, (double) ((float) p_147801_3_ + f), (double) (p_147801_4_ + 1), d2, d1);
      tessellator.addVertexWithUV(
          d9, (double) ((float) p_147801_3_ + f), (double) (p_147801_4_ + 1), d0, d1);
      tessellator.addVertexWithUV(
          d5, (double) (p_147801_3_ + 0), (double) (p_147801_4_ + 1), d0, d3);
      tessellator.addVertexWithUV(
          d5, (double) (p_147801_3_ + 0), (double) (p_147801_4_ + 0), d2, d3);
      tessellator.addVertexWithUV(
          d9, (double) ((float) p_147801_3_ + f), (double) (p_147801_4_ + 0), d2, d1);
      d0 = (double) iicon.getMinU();
      d1 = (double) iicon.getMinV();
      d2 = (double) iicon.getMaxU();
      d3 = (double) iicon.getMaxV();
      tessellator.addVertexWithUV(
          (double) (p_147801_2_ + 0), (double) ((float) p_147801_3_ + f), d11, d0, d1);
      tessellator.addVertexWithUV(
          (double) (p_147801_2_ + 0), (double) (p_147801_3_ + 0), d7, d0, d3);
      tessellator.addVertexWithUV(
          (double) (p_147801_2_ + 1), (double) (p_147801_3_ + 0), d7, d2, d3);
      tessellator.addVertexWithUV(
          (double) (p_147801_2_ + 1), (double) ((float) p_147801_3_ + f), d11, d2, d1);
      tessellator.addVertexWithUV(
          (double) (p_147801_2_ + 1), (double) ((float) p_147801_3_ + f), d10, d0, d1);
      tessellator.addVertexWithUV(
          (double) (p_147801_2_ + 1), (double) (p_147801_3_ + 0), d6, d0, d3);
      tessellator.addVertexWithUV(
          (double) (p_147801_2_ + 0), (double) (p_147801_3_ + 0), d6, d2, d3);
      tessellator.addVertexWithUV(
          (double) (p_147801_2_ + 0), (double) ((float) p_147801_3_ + f), d10, d2, d1);
    }

    return true;
  }