Example #1
0
  private void func_180474_b(float p_180474_1_, ScaledResolution p_180474_2_) {
    if (p_180474_1_ < 1.0F) {
      p_180474_1_ *= p_180474_1_;
      p_180474_1_ *= p_180474_1_;
      p_180474_1_ = p_180474_1_ * 0.8F + 0.2F;
    }

    GlStateManager.disableAlpha();
    GlStateManager.disableDepth();
    GlStateManager.depthMask(false);
    GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
    GlStateManager.color(1.0F, 1.0F, 1.0F, p_180474_1_);
    this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
    TextureAtlasSprite var3 =
        this.mc
            .getBlockRendererDispatcher()
            .func_175023_a()
            .func_178122_a(Blocks.portal.getDefaultState());
    float var4 = var3.getMinU();
    float var5 = var3.getMinV();
    float var6 = var3.getMaxU();
    float var7 = var3.getMaxV();
    Tessellator var8 = Tessellator.getInstance();
    WorldRenderer var9 = var8.getWorldRenderer();
    var9.startDrawingQuads();
    var9.addVertexWithUV(
        0.0D, (double) p_180474_2_.getScaledHeight(), -90.0D, (double) var4, (double) var7);
    var9.addVertexWithUV(
        (double) p_180474_2_.getScaledWidth(),
        (double) p_180474_2_.getScaledHeight(),
        -90.0D,
        (double) var6,
        (double) var7);
    var9.addVertexWithUV(
        (double) p_180474_2_.getScaledWidth(), 0.0D, -90.0D, (double) var6, (double) var5);
    var9.addVertexWithUV(0.0D, 0.0D, -90.0D, (double) var4, (double) var5);
    var8.draw();
    GlStateManager.depthMask(true);
    GlStateManager.enableDepth();
    GlStateManager.enableAlpha();
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
  }
Example #2
0
  /** Renders fire on top of the entity. Args: entity, x, y, z, partialTickTime */
  private void renderEntityOnFire(Entity entity, double x, double y, double z, float partialTicks) {
    GlStateManager.disableLighting();
    TextureMap texturemap = Minecraft.getMinecraft().getTextureMapBlocks();
    TextureAtlasSprite textureatlassprite =
        texturemap.getAtlasSprite("minecraft:blocks/fire_layer_0");
    TextureAtlasSprite textureatlassprite1 =
        texturemap.getAtlasSprite("minecraft:blocks/fire_layer_1");
    GlStateManager.pushMatrix();
    GlStateManager.translate((float) x, (float) y, (float) z);
    float f = entity.width * 1.4F;
    GlStateManager.scale(f, f, f);
    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    float f1 = 0.5F;
    float f2 = 0.0F;
    float f3 = entity.height / f;
    float f4 = (float) (entity.posY - entity.getEntityBoundingBox().minY);
    GlStateManager.rotate(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
    GlStateManager.translate(0.0F, 0.0F, -0.3F + (float) ((int) f3) * 0.02F);
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    float f5 = 0.0F;
    int i = 0;
    worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);

    while (f3 > 0.0F) {
      TextureAtlasSprite textureatlassprite2 =
          i % 2 == 0 ? textureatlassprite : textureatlassprite1;
      this.bindTexture(TextureMap.locationBlocksTexture);
      float f6 = textureatlassprite2.getMinU();
      float f7 = textureatlassprite2.getMinV();
      float f8 = textureatlassprite2.getMaxU();
      float f9 = textureatlassprite2.getMaxV();

      if (i / 2 % 2 == 0) {
        float f10 = f8;
        f8 = f6;
        f6 = f10;
      }

      worldrenderer
          .pos((double) (f1 - f2), (double) (0.0F - f4), (double) f5)
          .tex((double) f8, (double) f9)
          .endVertex();
      worldrenderer
          .pos((double) (-f1 - f2), (double) (0.0F - f4), (double) f5)
          .tex((double) f6, (double) f9)
          .endVertex();
      worldrenderer
          .pos((double) (-f1 - f2), (double) (1.4F - f4), (double) f5)
          .tex((double) f6, (double) f7)
          .endVertex();
      worldrenderer
          .pos((double) (f1 - f2), (double) (1.4F - f4), (double) f5)
          .tex((double) f8, (double) f7)
          .endVertex();
      f3 -= 0.45F;
      f4 -= 0.45F;
      f1 *= 0.9F;
      f5 += 0.03F;
      ++i;
    }

    tessellator.draw();
    GlStateManager.popMatrix();
    GlStateManager.enableLighting();
  }