Exemple #1
0
 /**
  * Renders the texture of the block the player is inside as an overlay. Args: partialTickTime,
  * blockTextureIndex
  */
 private void renderInsideOfBlock(float par1, int par2) {
   Tessellator tessellator = Tessellator.instance;
   float f = mc.thePlayer.getBrightness(par1);
   f = 0.1F;
   GL11.glColor4f(f, f, f, 0.5F);
   GL11.glPushMatrix();
   float f1 = -1F;
   float f2 = 1.0F;
   float f3 = -1F;
   float f4 = 1.0F;
   float f5 = -0.5F;
   float f6 = 0.0078125F;
   float f7 = (float) (par2 % 16) / 256F - f6;
   float f8 = ((float) (par2 % 16) + 15.99F) / 256F + f6;
   float f9 = (float) (par2 / 16) / 256F - f6;
   float f10 = ((float) (par2 / 16) + 15.99F) / 256F + f6;
   tessellator.startDrawingQuads();
   tessellator.addVertexWithUV(f1, f3, f5, f8, f10);
   tessellator.addVertexWithUV(f2, f3, f5, f7, f10);
   tessellator.addVertexWithUV(f2, f4, f5, f7, f9);
   tessellator.addVertexWithUV(f1, f4, f5, f8, f9);
   tessellator.draw();
   GL11.glPopMatrix();
   GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
 }
  private void func_78442_d(float p_78442_1_) {
    Tessellator tessellator = Tessellator.field_78398_a;
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.9F);
    GL11.glEnable(3042);
    GL11.glBlendFunc(770, 771);
    float f = 1.0F;
    for (int i = 0; i < 2; i++) {
      GL11.glPushMatrix();
      int j = Block.field_72067_ar.field_72059_bZ + i * 16;
      int k = (j & 0xf) << 4;
      int l = j & 0xf0;
      float f1 = (float) k / 256F;
      float f2 = ((float) k + 15.99F) / 256F;
      float f3 = (float) l / 256F;
      float f4 = ((float) l + 15.99F) / 256F;
      float f5 = (0.0F - f) / 2.0F;
      float f6 = f5 + f;
      float f7 = 0.0F - f / 2.0F;
      float f8 = f7 + f;
      float f9 = -0.5F;
      GL11.glTranslatef((float) (-(i * 2 - 1)) * 0.24F, -0.3F, 0.0F);
      GL11.glRotatef((float) (i * 2 - 1) * 10F, 0.0F, 1.0F, 0.0F);
      tessellator.func_78382_b();
      tessellator.func_78374_a(f5, f7, f9, f2, f4);
      tessellator.func_78374_a(f6, f7, f9, f1, f4);
      tessellator.func_78374_a(f6, f8, f9, f1, f3);
      tessellator.func_78374_a(f5, f8, f9, f2, f3);
      tessellator.func_78381_a();
      GL11.glPopMatrix();
    }

    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glDisable(3042);
  }
  /** draws the vertical line cursor in the textbox */
  private void drawCursorVertical(int par1, int par2, int par3, int par4) {
    int var5;

    if (par1 < par3) {
      var5 = par1;
      par1 = par3;
      par3 = var5;
    }

    if (par2 < par4) {
      var5 = par2;
      par2 = par4;
      par4 = var5;
    }

    Tessellator var6 = Tessellator.instance;
    GL11.glColor4f(0.0F, 0.0F, 255.0F, 255.0F);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glEnable(GL11.GL_COLOR_LOGIC_OP);
    GL11.glLogicOp(GL11.GL_OR_REVERSE);
    var6.startDrawingQuads();
    var6.addVertex((double) par1, (double) par4, 0.0D);
    var6.addVertex((double) par3, (double) par4, 0.0D);
    var6.addVertex((double) par3, (double) par2, 0.0D);
    var6.addVertex((double) par1, (double) par2, 0.0D);
    var6.draw();
    GL11.glDisable(GL11.GL_COLOR_LOGIC_OP);
    GL11.glEnable(GL11.GL_TEXTURE_2D);
  }
 private void func_78446_a(float p_78446_1_, int p_78446_2_) {
   Tessellator tessellator = Tessellator.field_78398_a;
   float f = field_78455_a.field_71439_g.func_70013_c(p_78446_1_);
   f = 0.1F;
   GL11.glColor4f(f, f, f, 0.5F);
   GL11.glPushMatrix();
   float f1 = -1F;
   float f2 = 1.0F;
   float f3 = -1F;
   float f4 = 1.0F;
   float f5 = -0.5F;
   float f6 = 0.0078125F;
   float f7 = (float) (p_78446_2_ % 16) / 256F - f6;
   float f8 = ((float) (p_78446_2_ % 16) + 15.99F) / 256F + f6;
   float f9 = (float) (p_78446_2_ / 16) / 256F - f6;
   float f10 = ((float) (p_78446_2_ / 16) + 15.99F) / 256F + f6;
   tessellator.func_78382_b();
   tessellator.func_78374_a(f1, f3, f5, f8, f10);
   tessellator.func_78374_a(f2, f3, f5, f7, f10);
   tessellator.func_78374_a(f2, f4, f5, f7, f9);
   tessellator.func_78374_a(f1, f4, f5, f8, f9);
   tessellator.func_78381_a();
   GL11.glPopMatrix();
   GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
 }
Exemple #5
0
  /** Renders the fire on the screen for first person mode. Arg: partialTickTime */
  private void renderFireInFirstPerson(float par1) {
    Tessellator tessellator = Tessellator.instance;
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.9F);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    float f = 1.0F;

    for (int i = 0; i < 2; i++) {
      GL11.glPushMatrix();
      int j = Block.fire.blockIndexInTexture + i * 16;
      int k = (j & 0xf) << 4;
      int l = j & 0xf0;
      float f1 = (float) k / 256F;
      float f2 = ((float) k + 15.99F) / 256F;
      float f3 = (float) l / 256F;
      float f4 = ((float) l + 15.99F) / 256F;
      float f5 = (0.0F - f) / 2.0F;
      float f6 = f5 + f;
      float f7 = 0.0F - f / 2.0F;
      float f8 = f7 + f;
      float f9 = -0.5F;
      GL11.glTranslatef((float) (-(i * 2 - 1)) * 0.24F, -0.3F, 0.0F);
      GL11.glRotatef((float) (i * 2 - 1) * 10F, 0.0F, 1.0F, 0.0F);
      tessellator.startDrawingQuads();
      tessellator.addVertexWithUV(f5, f7, f9, f2, f4);
      tessellator.addVertexWithUV(f6, f7, f9, f1, f4);
      tessellator.addVertexWithUV(f6, f8, f9, f1, f3);
      tessellator.addVertexWithUV(f5, f8, f9, f2, f3);
      tessellator.draw();
      GL11.glPopMatrix();
    }

    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glDisable(GL11.GL_BLEND);
  }
Exemple #6
0
  /** Draws a solid color rectangle with the specified coordinates and color. */
  public static void drawRect(int par0, int par1, int par2, int par3, int par4) {
    int var5;

    if (par0 < par2) {
      var5 = par0;
      par0 = par2;
      par2 = var5;
    }

    if (par1 < par3) {
      var5 = par1;
      par1 = par3;
      par3 = var5;
    }

    float var10 = (float) (par4 >> 24 & 255) / 255.0F;
    float var6 = (float) (par4 >> 16 & 255) / 255.0F;
    float var7 = (float) (par4 >> 8 & 255) / 255.0F;
    float var8 = (float) (par4 & 255) / 255.0F;
    Tessellator var9 = Tessellator.instance;
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glColor4f(var6, var7, var8, var10);
    var9.startDrawingQuads();
    var9.addVertex((double) par0, (double) par3, 0.0D);
    var9.addVertex((double) par2, (double) par3, 0.0D);
    var9.addVertex((double) par2, (double) par1, 0.0D);
    var9.addVertex((double) par0, (double) par1, 0.0D);
    var9.draw();
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glDisable(GL11.GL_BLEND);
  }
Exemple #7
0
 public void func_70539_a(
     Tessellator p_70539_1_,
     float p_70539_2_,
     float p_70539_3_,
     float p_70539_4_,
     float p_70539_5_,
     float p_70539_6_,
     float p_70539_7_) {
   float var8 = (float) (this.field_70550_a % 16) / 16.0F;
   float var9 = var8 + 0.0624375F;
   float var10 = (float) (this.field_70550_a / 16) / 16.0F;
   float var11 = var10 + 0.0624375F;
   float var12 = 0.1F * this.field_70544_f;
   float var13 =
       (float)
           (this.field_70169_q
               + (this.field_70165_t - this.field_70169_q) * (double) p_70539_2_
               - field_70556_an);
   float var14 =
       (float)
           (this.field_70167_r
               + (this.field_70163_u - this.field_70167_r) * (double) p_70539_2_
               - field_70554_ao);
   float var15 =
       (float)
           (this.field_70166_s
               + (this.field_70161_v - this.field_70166_s) * (double) p_70539_2_
               - field_70555_ap);
   float var16 = 1.0F;
   p_70539_1_.func_78386_a(
       this.field_70552_h * var16, this.field_70553_i * var16, this.field_70551_j * var16);
   p_70539_1_.func_78374_a(
       (double) (var13 - p_70539_3_ * var12 - p_70539_6_ * var12),
       (double) (var14 - p_70539_4_ * var12),
       (double) (var15 - p_70539_5_ * var12 - p_70539_7_ * var12),
       (double) var9,
       (double) var11);
   p_70539_1_.func_78374_a(
       (double) (var13 - p_70539_3_ * var12 + p_70539_6_ * var12),
       (double) (var14 + p_70539_4_ * var12),
       (double) (var15 - p_70539_5_ * var12 + p_70539_7_ * var12),
       (double) var9,
       (double) var10);
   p_70539_1_.func_78374_a(
       (double) (var13 + p_70539_3_ * var12 + p_70539_6_ * var12),
       (double) (var14 + p_70539_4_ * var12),
       (double) (var15 + p_70539_5_ * var12 + p_70539_7_ * var12),
       (double) var8,
       (double) var10);
   p_70539_1_.func_78374_a(
       (double) (var13 + p_70539_3_ * var12 - p_70539_6_ * var12),
       (double) (var14 - p_70539_4_ * var12),
       (double) (var15 + p_70539_5_ * var12 - p_70539_7_ * var12),
       (double) var8,
       (double) var11);
 }
  /** Draws the screen and all the components in it. */
  public void drawScreen(int par1, int par2, float par3) {
    this.renderSkybox(par1, par2, par3);
    Tessellator var4 = Tessellator.instance;
    short var5 = 274;
    int var6 = this.width / 2 - var5 / 2;
    byte var7 = 30;
    this.drawGradientRect(0, 0, this.width, this.height, -2130706433, 16777215);
    this.drawGradientRect(0, 0, this.width, this.height, 0, Integer.MIN_VALUE);
    GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/title/mclogo.png"));
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

    if ((double) this.updateCounter < 1.0E-4D) {
      this.drawTexturedModalRect(var6 + 0, var7 + 0, 0, 0, 99, 44);
      this.drawTexturedModalRect(var6 + 99, var7 + 0, 129, 0, 27, 44);
      this.drawTexturedModalRect(var6 + 99 + 26, var7 + 0, 126, 0, 3, 44);
      this.drawTexturedModalRect(var6 + 99 + 26 + 3, var7 + 0, 99, 0, 26, 44);
      this.drawTexturedModalRect(var6 + 155, var7 + 0, 0, 45, 155, 44);
    } else {
      this.drawTexturedModalRect(var6 + 0, var7 + 0, 0, 0, 155, 44);
      this.drawTexturedModalRect(var6 + 155, var7 + 0, 0, 45, 155, 44);
    }

    var4.setColorOpaque_I(16777215);
    GL11.glPushMatrix();
    GL11.glTranslatef((float) (this.width / 2 + 90), 70.0F, 0.0F);
    GL11.glRotatef(-20.0F, 0.0F, 0.0F, 1.0F);
    float var8 =
        1.8F
            - MathHelper.abs(
                MathHelper.sin(
                        (float) (Minecraft.getSystemTime() % 1000L)
                            / 1000.0F
                            * (float) Math.PI
                            * 2.0F)
                    * 0.1F);
    var8 = var8 * 100.0F / (float) (this.fontRenderer.getStringWidth(this.splashText) + 32);
    GL11.glScalef(var8, var8, var8);
    this.drawCenteredString(this.fontRenderer, this.splashText, 0, -8, 16776960);
    GL11.glPopMatrix();
    String var9 = "Minecraft 1.3.2";

    if (this.mc.isDemo()) {
      var9 = var9 + " Demo";
    }

    this.drawString(this.fontRenderer, var9, 2, this.height - 10, 16777215);
    String var10 = "Copyright Mojang AB. Ported by Nick Parker";
    this.drawString(
        this.fontRenderer,
        var10,
        this.width - this.fontRenderer.getStringWidth(var10) - 2,
        this.height - 10,
        16777215);
    super.drawScreen(par1, par2, par3);
  }
Exemple #9
0
 /** Overlays the background to hide scrolled items */
 private void overlayBackground(int par1, int par2, int par3, int par4) {
   // Spout Start
   GL11.glPushMatrix();
   // Spout End
   Tessellator var5 = Tessellator.instance;
   GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/gui/background.png"));
   GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
   // Spout Start
   GL11.glTranslatef(0, 0, -0.1f);
   // Spout End
   float var6 = 32.0F;
   var5.startDrawingQuads();
   var5.setColorRGBA_I(4210752, par4);
   var5.addVertexWithUV(0.0D, (double) par2, 0.0D, 0.0D, (double) ((float) par2 / var6));
   var5.addVertexWithUV(
       (double) this.width,
       (double) par2,
       0.0D,
       (double) ((float) this.width / var6),
       (double) ((float) par2 / var6));
   var5.setColorRGBA_I(4210752, par3);
   var5.addVertexWithUV(
       (double) this.width,
       (double) par1,
       0.0D,
       (double) ((float) this.width / var6),
       (double) ((float) par1 / var6));
   var5.addVertexWithUV(0.0D, (double) par1, 0.0D, 0.0D, (double) ((float) par1 / var6));
   var5.draw();
   // Spout Start
   GL11.glPopMatrix();
   // Spout End
 }
  /** Renders the animation for when an enderdragon dies */
  protected void renderDragonDying(EntityDragon par1EntityDragon, float par2) {
    super.renderEquippedItems(par1EntityDragon, par2);
    Tessellator tessellator = Tessellator.instance;

    if (par1EntityDragon.deathTicks > 0) {
      RenderHelper.disableStandardItemLighting();
      float f = ((float) par1EntityDragon.deathTicks + par2) / 200F;
      float f1 = 0.0F;

      if (f > 0.8F) {
        f1 = (f - 0.8F) / 0.2F;
      }

      Random random = new Random(432L);
      GL11.glDisable(GL11.GL_TEXTURE_2D);
      GL11.glShadeModel(GL11.GL_SMOOTH);
      GL11.glEnable(GL11.GL_BLEND);
      GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
      GL11.glDisable(GL11.GL_ALPHA_TEST);
      GL11.glEnable(GL11.GL_CULL_FACE);
      GL11.glDepthMask(false);
      GL11.glPushMatrix();
      GL11.glTranslatef(0.0F, -1F, -2F);

      for (int i = 0; (float) i < ((f + f * f) / 2.0F) * 60F; i++) {
        GL11.glRotatef(random.nextFloat() * 360F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(random.nextFloat() * 360F, 0.0F, 1.0F, 0.0F);
        GL11.glRotatef(random.nextFloat() * 360F, 0.0F, 0.0F, 1.0F);
        GL11.glRotatef(random.nextFloat() * 360F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(random.nextFloat() * 360F, 0.0F, 1.0F, 0.0F);
        GL11.glRotatef(random.nextFloat() * 360F + f * 90F, 0.0F, 0.0F, 1.0F);
        tessellator.startDrawing(6);
        float f2 = random.nextFloat() * 20F + 5F + f1 * 10F;
        float f3 = random.nextFloat() * 2.0F + 1.0F + f1 * 2.0F;
        tessellator.setColorRGBA_I(0xffffff, (int) (255F * (1.0F - f1)));
        tessellator.addVertex(0.0D, 0.0D, 0.0D);
        tessellator.setColorRGBA_I(0xff00ff, 0);
        tessellator.addVertex(-0.86599999999999999D * (double) f3, f2, -0.5F * f3);
        tessellator.addVertex(0.86599999999999999D * (double) f3, f2, -0.5F * f3);
        tessellator.addVertex(0.0D, f2, 1.0F * f3);
        tessellator.addVertex(-0.86599999999999999D * (double) f3, f2, -0.5F * f3);
        tessellator.draw();
      }

      GL11.glPopMatrix();
      GL11.glDepthMask(true);
      GL11.glDisable(GL11.GL_CULL_FACE);
      GL11.glDisable(GL11.GL_BLEND);
      GL11.glShadeModel(GL11.GL_FLAT);
      GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
      GL11.glEnable(GL11.GL_TEXTURE_2D);
      GL11.glEnable(GL11.GL_ALPHA_TEST);
      RenderHelper.enableStandardItemLighting();
    }
  }
 public void func_579_b(int p_579_1_) {
   GL11.glDisable(2896);
   GL11.glDisable(2912);
   Tessellator var2 = Tessellator.field_1512_a;
   GL11.glBindTexture(3553, this.field_945_b.field_6315_n.func_1070_a("/gui/background.png"));
   GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
   float var3 = 32.0F;
   var2.func_977_b();
   var2.func_990_b(4210752);
   var2.func_983_a(
       0.0D,
       (double) this.field_950_d,
       0.0D,
       0.0D,
       (double) ((float) this.field_950_d / var3 + (float) p_579_1_));
   var2.func_983_a(
       (double) this.field_951_c,
       (double) this.field_950_d,
       0.0D,
       (double) ((float) this.field_951_c / var3),
       (double) ((float) this.field_950_d / var3 + (float) p_579_1_));
   var2.func_983_a(
       (double) this.field_951_c,
       0.0D,
       0.0D,
       (double) ((float) this.field_951_c / var3),
       (double) p_579_1_);
   var2.func_983_a(0.0D, 0.0D, 0.0D, 0.0D, (double) p_579_1_);
   var2.func_982_a();
 }
 /** Renders the skybox in the main menu */
 private void renderSkybox(int par1, int par2, float par3) {
   GL11.glViewport(0, 0, 256, 256);
   drawPanorama(par1, par2, par3);
   GL11.glDisable(GL11.GL_TEXTURE_2D);
   GL11.glEnable(GL11.GL_TEXTURE_2D);
   rotateAndBlurSkybox(par3);
   rotateAndBlurSkybox(par3);
   rotateAndBlurSkybox(par3);
   rotateAndBlurSkybox(par3);
   rotateAndBlurSkybox(par3);
   rotateAndBlurSkybox(par3);
   rotateAndBlurSkybox(par3);
   rotateAndBlurSkybox(par3);
   GL11.glViewport(0, 0, mc.displayWidth, mc.displayHeight);
   Tessellator tessellator = Tessellator.instance;
   tessellator.startDrawingQuads();
   float f = width <= height ? 120F / (float) height : 120F / (float) width;
   float f1 = ((float) height * f) / 256F;
   float f2 = ((float) width * f) / 256F;
   GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR);
   GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);
   tessellator.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F);
   int i = width;
   int j = height;
   tessellator.addVertexWithUV(0.0D, j, zLevel, 0.5F - f1, 0.5F + f2);
   tessellator.addVertexWithUV(i, j, zLevel, 0.5F - f1, 0.5F - f2);
   tessellator.addVertexWithUV(i, 0.0D, zLevel, 0.5F + f1, 0.5F - f2);
   tessellator.addVertexWithUV(0.0D, 0.0D, zLevel, 0.5F + f1, 0.5F + f2);
   tessellator.draw();
 }
  /** Rotate and blurs the skybox view in the main menu */
  private void rotateAndBlurSkybox(float par1) {
    GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.viewportTexture);
    this.mc.renderEngine.func_98185_a();
    GL11.glCopyTexSubImage2D(GL11.GL_TEXTURE_2D, 0, 0, 0, 0, 0, 256, 256);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glColorMask(true, true, true, false);
    Tessellator var2 = Tessellator.instance;
    var2.startDrawingQuads();
    byte var3 = 3;

    for (int var4 = 0; var4 < var3; ++var4) {
      var2.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F / (float) (var4 + 1));
      int var5 = this.width;
      int var6 = this.height;
      float var7 = (float) (var4 - var3 / 2) / 256.0F;
      var2.addVertexWithUV(
          (double) var5, (double) var6, (double) this.zLevel, (double) (0.0F + var7), 0.0D);
      var2.addVertexWithUV((double) var5, 0.0D, (double) this.zLevel, (double) (1.0F + var7), 0.0D);
      var2.addVertexWithUV(0.0D, 0.0D, (double) this.zLevel, (double) (1.0F + var7), 1.0D);
      var2.addVertexWithUV(0.0D, (double) var6, (double) this.zLevel, (double) (0.0F + var7), 1.0D);
    }

    var2.draw();
    GL11.glColorMask(true, true, true, true);
    this.mc.renderEngine.func_98185_a();
  }
 protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) {
   TexturePackBase var6 =
       (TexturePackBase)
           GuiTexturePacks.func_73953_j(this.parentTexturePackGui)
               .texturePackList
               .availableTexturePacks()
               .get(par1);
   var6.bindThumbnailTexture(GuiTexturePacks.func_73961_k(this.parentTexturePackGui).renderEngine);
   GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
   par5Tessellator.startDrawingQuads();
   par5Tessellator.setColorOpaque_I(16777215);
   par5Tessellator.addVertexWithUV((double) par2, (double) (par3 + par4), 0.0D, 0.0D, 1.0D);
   par5Tessellator.addVertexWithUV((double) (par2 + 32), (double) (par3 + par4), 0.0D, 1.0D, 1.0D);
   par5Tessellator.addVertexWithUV((double) (par2 + 32), (double) par3, 0.0D, 1.0D, 0.0D);
   par5Tessellator.addVertexWithUV((double) par2, (double) par3, 0.0D, 0.0D, 0.0D);
   par5Tessellator.draw();
   this.parentTexturePackGui.drawString(
       GuiTexturePacks.func_73960_l(this.parentTexturePackGui),
       var6.getTexturePackFileName(),
       par2 + 32 + 2,
       par3 + 1,
       16777215);
   this.parentTexturePackGui.drawString(
       GuiTexturePacks.func_73963_m(this.parentTexturePackGui),
       var6.getFirstDescriptionLine(),
       par2 + 32 + 2,
       par3 + 12,
       8421504);
   this.parentTexturePackGui.drawString(
       GuiTexturePacks.func_73954_n(this.parentTexturePackGui),
       var6.getSecondDescriptionLine(),
       par2 + 32 + 2,
       par3 + 12 + 10,
       8421504);
 }
Exemple #15
0
 private void renderInsideOfBlock(float par1, int par2) {
   Tessellator var3 = Tessellator.instance;
   this.mc.thePlayer.getBrightness(par1);
   float var4 = 0.1F;
   GL11.glColor4f(var4, var4, var4, 0.5F);
   GL11.glPushMatrix();
   float var5 = -1.0F;
   float var6 = 1.0F;
   float var7 = -1.0F;
   float var8 = 1.0F;
   float var9 = -0.5F;
   float var10 = 0.0078125F;
   float var11 = (float) (par2 % 16) / 256.0F - var10;
   float var12 = ((float) (par2 % 16) + 15.99F) / 256.0F + var10;
   float var13 = (float) (par2 / 16) / 256.0F - var10;
   float var14 = ((float) (par2 / 16) + 15.99F) / 256.0F + var10;
   var3.startDrawingQuads();
   var3.addVertexWithUV(
       (double) var5, (double) var7, (double) var9, (double) var12, (double) var14);
   var3.addVertexWithUV(
       (double) var6, (double) var7, (double) var9, (double) var11, (double) var14);
   var3.addVertexWithUV(
       (double) var6, (double) var8, (double) var9, (double) var11, (double) var13);
   var3.addVertexWithUV(
       (double) var5, (double) var8, (double) var9, (double) var12, (double) var13);
   var3.draw();
   GL11.glPopMatrix();
   GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
 }
 private void renderMenuBlock(Block block, float f, RenderBlocks renderblocks) {
   int i = block.getRenderType();
   renderblocks.setRenderBoundsFromBlock(block);
   Tessellator tessellator = Tessellator.instance;
   if (i == 0) {
     block.setBlockBoundsForItemRender();
     GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
     float f1 = 0.5F;
     float f2 = 1.0F;
     float f3 = 0.8F;
     float f4 = 0.6F;
     tessellator.startDrawingQuads();
     tessellator.setColorRGBA_F(f2, f2, f2, f);
     renderblocks.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(0));
     tessellator.setColorRGBA_F(f1, f1, f1, f);
     renderblocks.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(1));
     tessellator.setColorRGBA_F(f3, f3, f3, f);
     renderblocks.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(2));
     renderblocks.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(3));
     tessellator.setColorRGBA_F(f4, f4, f4, f);
     renderblocks.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(4));
     renderblocks.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSide(5));
     tessellator.draw();
     GL11.glTranslatef(0.5F, 0.5F, 0.5F);
   }
 }
Exemple #17
0
 private void renderVignette(float f, int i, int j) {
   f = 1.0F - f;
   if (f < 0.0F) {
     f = 0.0F;
   }
   if (f > 1.0F) {
     f = 1.0F;
   }
   prevVignetteBrightness += (double) (f - prevVignetteBrightness) * 0.01D;
   GL11.glDisable(2929 /*GL_DEPTH_TEST*/);
   GL11.glDepthMask(false);
   GL11.glBlendFunc(0, 769);
   GL11.glColor4f(prevVignetteBrightness, prevVignetteBrightness, prevVignetteBrightness, 1.0F);
   GL11.glBindTexture(
       3553 /*GL_TEXTURE_2D*/, mc.renderEngine.getTexture("%blur%/misc/vignette.png"));
   Tessellator tessellator = Tessellator.instance;
   tessellator.startDrawingQuads();
   tessellator.addVertexWithUV(0.0D, j, -90D, 0.0D, 1.0D);
   tessellator.addVertexWithUV(i, j, -90D, 1.0D, 1.0D);
   tessellator.addVertexWithUV(i, 0.0D, -90D, 1.0D, 0.0D);
   tessellator.addVertexWithUV(0.0D, 0.0D, -90D, 0.0D, 0.0D);
   tessellator.draw();
   GL11.glDepthMask(true);
   GL11.glEnable(2929 /*GL_DEPTH_TEST*/);
   GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
   GL11.glBlendFunc(770, 771);
 }
Exemple #18
0
 /** Draws a rectangle with a vertical gradient between the specified colors. */
 protected void drawGradientRect(int par1, int par2, int par3, int par4, int par5, int par6) {
   float var7 = (float) (par5 >> 24 & 255) / 255.0F;
   float var8 = (float) (par5 >> 16 & 255) / 255.0F;
   float var9 = (float) (par5 >> 8 & 255) / 255.0F;
   float var10 = (float) (par5 & 255) / 255.0F;
   float var11 = (float) (par6 >> 24 & 255) / 255.0F;
   float var12 = (float) (par6 >> 16 & 255) / 255.0F;
   float var13 = (float) (par6 >> 8 & 255) / 255.0F;
   float var14 = (float) (par6 & 255) / 255.0F;
   GL11.glDisable(GL11.GL_TEXTURE_2D);
   GL11.glEnable(GL11.GL_BLEND);
   GL11.glDisable(GL11.GL_ALPHA_TEST);
   GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
   GL11.glShadeModel(GL11.GL_SMOOTH);
   Tessellator var15 = Tessellator.instance;
   var15.startDrawingQuads();
   var15.setColorRGBA_F(var8, var9, var10, var7);
   var15.addVertex((double) par3, (double) par2, (double) this.zLevel);
   var15.addVertex((double) par1, (double) par2, (double) this.zLevel);
   var15.setColorRGBA_F(var12, var13, var14, var11);
   var15.addVertex((double) par1, (double) par4, (double) this.zLevel);
   var15.addVertex((double) par3, (double) par4, (double) this.zLevel);
   var15.draw();
   GL11.glShadeModel(GL11.GL_FLAT);
   GL11.glDisable(GL11.GL_BLEND);
   GL11.glEnable(GL11.GL_ALPHA_TEST);
   GL11.glEnable(GL11.GL_TEXTURE_2D);
 }
Exemple #19
0
 private void overlayBackground(int i, int j, int k, int l) {
   Tessellator tessellator = Tessellator.instance;
   GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, mc.renderEngine.getTexture("/gui/background.png"));
   GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
   float f = 32F;
   tessellator.startDrawingQuads();
   tessellator.setColorRGBA_I(0x404040, l);
   tessellator.addVertexWithUV(0.0D, j, 0.0D, 0.0D, (float) j / f);
   tessellator.addVertexWithUV(width, j, 0.0D, (float) width / f, (float) j / f);
   tessellator.setColorRGBA_I(0x404040, k);
   tessellator.addVertexWithUV(width, i, 0.0D, (float) width / f, (float) i / f);
   tessellator.addVertexWithUV(0.0D, i, 0.0D, 0.0D, (float) i / f);
   tessellator.draw();
 }
Exemple #20
0
 /** Draws a textured rectangle at the stored z-value. Args: x, y, u, v, width, height */
 public void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) {
   float var7 = 0.00390625F;
   float var8 = 0.00390625F;
   Tessellator var9 = Tessellator.instance;
   var9.startDrawingQuads();
   var9.addVertexWithUV(
       (double) (par1 + 0),
       (double) (par2 + par6),
       (double) this.zLevel,
       (double) ((float) (par3 + 0) * var7),
       (double) ((float) (par4 + par6) * var8));
   var9.addVertexWithUV(
       (double) (par1 + par5),
       (double) (par2 + par6),
       (double) this.zLevel,
       (double) ((float) (par3 + par5) * var7),
       (double) ((float) (par4 + par6) * var8));
   var9.addVertexWithUV(
       (double) (par1 + par5),
       (double) (par2 + 0),
       (double) this.zLevel,
       (double) ((float) (par3 + par5) * var7),
       (double) ((float) (par4 + 0) * var8));
   var9.addVertexWithUV(
       (double) (par1 + 0),
       (double) (par2 + 0),
       (double) this.zLevel,
       (double) ((float) (par3 + 0) * var7),
       (double) ((float) (par4 + 0) * var8));
   var9.draw();
 }
Exemple #21
0
  private void renderPortalOverlay(float var1, int var2, int var3) {
    if (var1 < 1.0F) {
      var1 *= var1;
      var1 *= var1;
      var1 = var1 * 0.8F + 0.2F;
    }

    GL11.glDisable(3008 /*GL_ALPHA_TEST*/);
    GL11.glDisable(2929 /*GL_DEPTH_TEST*/);
    GL11.glDepthMask(false);
    GL11.glBlendFunc(770, 771);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, var1);
    GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, this.mc.renderEngine.getTexture("/terrain.png"));
    float var4 = (float) (Block.portal.blockIndexInTexture % 16) / 16.0F;
    float var5 = (float) (Block.portal.blockIndexInTexture / 16) / 16.0F;
    float var6 = (float) (Block.portal.blockIndexInTexture % 16 + 1) / 16.0F;
    float var7 = (float) (Block.portal.blockIndexInTexture / 16 + 1) / 16.0F;
    Tessellator var8 = Tessellator.instance;
    var8.startDrawingQuads();
    var8.addVertexWithUV(0.0D, (double) var3, -90.0D, (double) var4, (double) var7);
    var8.addVertexWithUV((double) var2, (double) var3, -90.0D, (double) var6, (double) var7);
    var8.addVertexWithUV((double) var2, 0.0D, -90.0D, (double) var6, (double) var5);
    var8.addVertexWithUV(0.0D, 0.0D, -90.0D, (double) var4, (double) var5);
    var8.draw();
    GL11.glDepthMask(true);
    GL11.glEnable(2929 /*GL_DEPTH_TEST*/);
    GL11.glEnable(3008 /*GL_ALPHA_TEST*/);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
  }
 /** Draws a sprite from /gui/slot.png. */
 private void drawSprite(int par1, int par2, int par3, int par4) {
   int i = mc.renderEngine.getTexture("/gui/slot.png");
   GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
   mc.renderEngine.bindTexture(i);
   Tessellator tessellator = Tessellator.instance;
   tessellator.startDrawingQuads();
   tessellator.addVertexWithUV(
       par1 + 0,
       par2 + 18,
       zLevel,
       (float) (par3 + 0) * 0.0078125F,
       (float) (par4 + 18) * 0.0078125F);
   tessellator.addVertexWithUV(
       par1 + 18,
       par2 + 18,
       zLevel,
       (float) (par3 + 18) * 0.0078125F,
       (float) (par4 + 18) * 0.0078125F);
   tessellator.addVertexWithUV(
       par1 + 18,
       par2 + 0,
       zLevel,
       (float) (par3 + 18) * 0.0078125F,
       (float) (par4 + 0) * 0.0078125F);
   tessellator.addVertexWithUV(
       par1 + 0,
       par2 + 0,
       zLevel,
       (float) (par3 + 0) * 0.0078125F,
       (float) (par4 + 0) * 0.0078125F);
   tessellator.draw();
 }
Exemple #23
0
 private void renderPortalOverlay(float f, int i, int j) {
   if (f < 1.0F) {
     f *= f;
     f *= f;
     f = f * 0.8F + 0.2F;
   }
   GL11.glDisable(3008 /*GL_ALPHA_TEST*/);
   GL11.glDisable(2929 /*GL_DEPTH_TEST*/);
   GL11.glDepthMask(false);
   GL11.glBlendFunc(770, 771);
   GL11.glColor4f(1.0F, 1.0F, 1.0F, f);
   GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, mc.renderEngine.getTexture("/terrain.png"));
   float f1 = (float) (Block.portal.blockIndexInTexture % 16) / 16F;
   float f2 = (float) (Block.portal.blockIndexInTexture / 16) / 16F;
   float f3 = (float) (Block.portal.blockIndexInTexture % 16 + 1) / 16F;
   float f4 = (float) (Block.portal.blockIndexInTexture / 16 + 1) / 16F;
   Tessellator tessellator = Tessellator.instance;
   tessellator.startDrawingQuads();
   tessellator.addVertexWithUV(0.0D, j, -90D, f1, f4);
   tessellator.addVertexWithUV(i, j, -90D, f3, f4);
   tessellator.addVertexWithUV(i, 0.0D, -90D, f3, f2);
   tessellator.addVertexWithUV(0.0D, 0.0D, -90D, f1, f2);
   tessellator.draw();
   GL11.glDepthMask(true);
   GL11.glEnable(2929 /*GL_DEPTH_TEST*/);
   GL11.glEnable(3008 /*GL_ALPHA_TEST*/);
   GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
 }
 private void func_78448_c(float p_78448_1_) {
   Tessellator tessellator = Tessellator.field_78398_a;
   float f = field_78455_a.field_71439_g.func_70013_c(p_78448_1_);
   GL11.glColor4f(f, f, f, 0.5F);
   GL11.glEnable(3042);
   GL11.glBlendFunc(770, 771);
   GL11.glPushMatrix();
   float f1 = 4F;
   float f2 = -1F;
   float f3 = 1.0F;
   float f4 = -1F;
   float f5 = 1.0F;
   float f6 = -0.5F;
   float f7 = -field_78455_a.field_71439_g.field_70177_z / 64F;
   float f8 = field_78455_a.field_71439_g.field_70125_A / 64F;
   tessellator.func_78382_b();
   tessellator.func_78374_a(f2, f4, f6, f1 + f7, f1 + f8);
   tessellator.func_78374_a(f3, f4, f6, 0.0F + f7, f1 + f8);
   tessellator.func_78374_a(f3, f5, f6, 0.0F + f7, 0.0F + f8);
   tessellator.func_78374_a(f2, f5, f6, f1 + f7, 0.0F + f8);
   tessellator.func_78381_a();
   GL11.glPopMatrix();
   GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
   GL11.glDisable(3042);
 }
Exemple #25
0
 /**
  * Renders a texture that warps around based on the direction the player is looking. Texture needs
  * to be bound before being called. Used for the water overlay. Args: parialTickTime
  */
 private void renderWarpedTextureOverlay(float par1) {
   Tessellator tessellator = Tessellator.instance;
   float f = mc.thePlayer.getBrightness(par1);
   GL11.glColor4f(f, f, f, 0.5F);
   GL11.glEnable(GL11.GL_BLEND);
   GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
   GL11.glPushMatrix();
   float f1 = 4F;
   float f2 = -1F;
   float f3 = 1.0F;
   float f4 = -1F;
   float f5 = 1.0F;
   float f6 = -0.5F;
   float f7 = -mc.thePlayer.rotationYaw / 64F;
   float f8 = mc.thePlayer.rotationPitch / 64F;
   tessellator.startDrawingQuads();
   tessellator.addVertexWithUV(f2, f4, f6, f1 + f7, f1 + f8);
   tessellator.addVertexWithUV(f3, f4, f6, 0.0F + f7, f1 + f8);
   tessellator.addVertexWithUV(f3, f5, f6, 0.0F + f7, 0.0F + f8);
   tessellator.addVertexWithUV(f2, f5, f6, f1 + f7, 0.0F + f8);
   tessellator.draw();
   GL11.glPopMatrix();
   GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
   GL11.glDisable(GL11.GL_BLEND);
 }
 private void func_82455_b(int par1, int par2, int par3, int par4) {
   int var5 = this.flatPresetsGui.mc.renderEngine.getTexture("/gui/slot.png");
   GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
   this.flatPresetsGui.mc.renderEngine.bindTexture(var5);
   Tessellator var10 = Tessellator.instance;
   var10.startDrawingQuads();
   var10.addVertexWithUV(
       (double) (par1 + 0),
       (double) (par2 + 18),
       (double) this.flatPresetsGui.zLevel,
       (double) ((float) (par3 + 0) * 0.0078125F),
       (double) ((float) (par4 + 18) * 0.0078125F));
   var10.addVertexWithUV(
       (double) (par1 + 18),
       (double) (par2 + 18),
       (double) this.flatPresetsGui.zLevel,
       (double) ((float) (par3 + 18) * 0.0078125F),
       (double) ((float) (par4 + 18) * 0.0078125F));
   var10.addVertexWithUV(
       (double) (par1 + 18),
       (double) (par2 + 0),
       (double) this.flatPresetsGui.zLevel,
       (double) ((float) (par3 + 18) * 0.0078125F),
       (double) ((float) (par4 + 0) * 0.0078125F));
   var10.addVertexWithUV(
       (double) (par1 + 0),
       (double) (par2 + 0),
       (double) this.flatPresetsGui.zLevel,
       (double) ((float) (par3 + 0) * 0.0078125F),
       (double) ((float) (par4 + 0) * 0.0078125F));
   var10.draw();
 }
Exemple #27
0
  protected void renderLivingLabel(
      EntityLiving var1,
      String var2,
      double var3,
      double var5,
      double var7,
      int var9,
      int color,
      int color2) {
    // Spout end
    float var10 = var1.getDistanceToEntity(this.renderManager.livingPlayer);
    if (var10 <= (float) var9) {
      FontRenderer var11 = this.getFontRendererFromRenderManager();
      float var12 = 1.6F;
      float var13 = 0.016666668F * var12;
      GL11.glPushMatrix();
      GL11.glTranslatef((float) var3 + 0.0F, (float) var5 + 2.3F, (float) var7);
      GL11.glNormal3f(0.0F, 1.0F, 0.0F);
      GL11.glRotatef(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
      GL11.glRotatef(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
      GL11.glScalef(-var13, -var13, var13);
      GL11.glDisable(2896 /*GL_LIGHTING*/);
      GL11.glDepthMask(false);
      GL11.glDisable(2929 /*GL_DEPTH_TEST*/);
      GL11.glEnable(3042 /*GL_BLEND*/);
      GL11.glBlendFunc(770, 771);
      Tessellator var14 = Tessellator.instance;
      byte var15 = 0;
      if (var2.equals("deadmau5")) {
        var15 = -10;
      }

      GL11.glDisable(3553 /*GL_TEXTURE_2D*/);
      var14.startDrawingQuads();
      int var16 = var11.getStringWidth(var2) / 2;
      var14.setColorRGBA_F(0.0F, 0.0F, 0.0F, 0.25F);
      var14.addVertex((double) (-var16 - 1), (double) (-1 + var15), 0.0D);
      var14.addVertex((double) (-var16 - 1), (double) (8 + var15), 0.0D);
      var14.addVertex((double) (var16 + 1), (double) (8 + var15), 0.0D);
      var14.addVertex((double) (var16 + 1), (double) (-1 + var15), 0.0D);
      var14.draw();
      GL11.glEnable(3553 /*GL_TEXTURE_2D*/);
      var11.drawString(
          var2, -var11.getStringWidth(var2) / 2, var15, color); // Spout (changed to color var)
      GL11.glEnable(2929 /*GL_DEPTH_TEST*/);
      GL11.glDepthMask(true);
      var11.drawString(
          var2, -var11.getStringWidth(var2) / 2, var15, color2); // Spout (changed to color2 var)
      GL11.glEnable(2896 /*GL_LIGHTING*/);
      GL11.glDisable(3042 /*GL_BLEND*/);
      GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
      GL11.glPopMatrix();
    }
  }
  /** The actual render method that is used in doRender */
  public void doRenderFallingSand(
      EntityFallingSand par1EntityFallingSand,
      double par2,
      double par4,
      double par6,
      float par8,
      float par9) {
    GL11.glPushMatrix();
    GL11.glTranslatef((float) par2, (float) par4, (float) par6);
    this.loadTexture("/terrain.png");
    Block var10 = Block.blocksList[par1EntityFallingSand.blockID];
    World var11 = par1EntityFallingSand.getWorld();
    GL11.glDisable(GL11.GL_LIGHTING);

    if (var10 instanceof BlockAnvil && var10.getRenderType() == 35) {
      this.renderBlocks.blockAccess = var11;
      Tessellator var12 = Tessellator.instance;
      var12.startDrawingQuads();
      var12.setTranslation(
          (double) ((float) (-MathHelper.floor_double(par1EntityFallingSand.posX)) - 0.5F),
          (double) ((float) (-MathHelper.floor_double(par1EntityFallingSand.posY)) - 0.5F),
          (double) ((float) (-MathHelper.floor_double(par1EntityFallingSand.posZ)) - 0.5F));
      this.renderBlocks.renderBlockAnvilMetadata(
          (BlockAnvil) var10,
          MathHelper.floor_double(par1EntityFallingSand.posX),
          MathHelper.floor_double(par1EntityFallingSand.posY),
          MathHelper.floor_double(par1EntityFallingSand.posZ),
          par1EntityFallingSand.metadata);
      var12.setTranslation(0.0D, 0.0D, 0.0D);
      var12.draw();
    } else if (var10 != null) {
      this.renderBlocks.updateCustomBlockBounds(var10);
      this.renderBlocks.renderBlockSandFalling(
          var10,
          var11,
          MathHelper.floor_double(par1EntityFallingSand.posX),
          MathHelper.floor_double(par1EntityFallingSand.posY),
          MathHelper.floor_double(par1EntityFallingSand.posZ),
          par1EntityFallingSand.metadata);
    }

    GL11.glEnable(GL11.GL_LIGHTING);
    GL11.glPopMatrix();
  }
  /** Draws the debug or playername text above a living */
  protected void renderLivingLabel(
      EntityLiving par1EntityLiving,
      String par2Str,
      double par3,
      double par5,
      double par7,
      int par9) {
    float f = par1EntityLiving.getDistanceToEntity(renderManager.livingPlayer);

    if (f > (float) par9) {
      return;
    }

    FontRenderer fontrenderer = getFontRendererFromRenderManager();
    float f1 = 1.6F;
    float f2 = 0.01666667F * f1;
    GL11.glPushMatrix();
    GL11.glTranslatef((float) par3 + 0.0F, (float) par5 + 2.3F, (float) par7);
    GL11.glNormal3f(0.0F, 1.0F, 0.0F);
    GL11.glRotatef(-renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
    GL11.glRotatef(renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
    GL11.glScalef(-f2, -f2, f2);
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glDepthMask(false);
    GL11.glDisable(GL11.GL_DEPTH_TEST);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    Tessellator tessellator = Tessellator.instance;
    byte byte0 = 0;

    if (par2Str.equals("deadmau5")) {
      byte0 = -10;
    }

    GL11.glDisable(GL11.GL_TEXTURE_2D);
    tessellator.startDrawingQuads();
    int i = fontrenderer.getStringWidth(par2Str) / 2;
    tessellator.setColorRGBA_F(0.0F, 0.0F, 0.0F, 0.25F);
    tessellator.addVertex(-i - 1, -1 + byte0, 0.0D);
    tessellator.addVertex(-i - 1, 8 + byte0, 0.0D);
    tessellator.addVertex(i + 1, 8 + byte0, 0.0D);
    tessellator.addVertex(i + 1, -1 + byte0, 0.0D);
    tessellator.draw();
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    fontrenderer.drawString(par2Str, -fontrenderer.getStringWidth(par2Str) / 2, byte0, 0x20ffffff);
    GL11.glEnable(GL11.GL_DEPTH_TEST);
    GL11.glDepthMask(true);
    fontrenderer.drawString(par2Str, -fontrenderer.getStringWidth(par2Str) / 2, byte0, -1);
    GL11.glEnable(GL11.GL_LIGHTING);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glPopMatrix();
  }
  /** Used to render a player's name above their head */
  protected void renderName(EntityPlayer par1EntityPlayer, double par2, double par4, double par6) {
    if (Minecraft.isGuiEnabled() && par1EntityPlayer != renderManager.livingPlayer) {
      float f = 1.6F;
      float f1 = 0.01666667F * f;
      float f2 = par1EntityPlayer.getDistanceToEntity(renderManager.livingPlayer);
      float f3 = par1EntityPlayer.isSneaking() ? 32F : 64F;

      if (f2 < f3) {
        String s = par1EntityPlayer.username;

        if (!par1EntityPlayer.isSneaking()) {
          if (par1EntityPlayer.isPlayerSleeping()) {
            renderLivingLabel(par1EntityPlayer, s, par2, par4 - 1.5D, par6, 64);
          } else {
            renderLivingLabel(par1EntityPlayer, s, par2, par4, par6, 64);
          }
        } else {
          FontRenderer fontrenderer = getFontRendererFromRenderManager();
          GL11.glPushMatrix();
          GL11.glTranslatef((float) par2 + 0.0F, (float) par4 + 2.3F, (float) par6);
          GL11.glNormal3f(0.0F, 1.0F, 0.0F);
          GL11.glRotatef(-renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
          GL11.glRotatef(renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
          GL11.glScalef(-f1, -f1, f1);
          GL11.glDisable(GL11.GL_LIGHTING);
          GL11.glTranslatef(0.0F, 0.25F / f1, 0.0F);
          GL11.glDepthMask(false);
          GL11.glEnable(GL11.GL_BLEND);
          GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
          Tessellator tessellator = Tessellator.instance;
          GL11.glDisable(GL11.GL_TEXTURE_2D);
          tessellator.startDrawingQuads();
          int i = fontrenderer.getStringWidth(s) / 2;

          tessellator.setColorRGBA_F(0.0F, 0.0F, 0.0F, 0.25F);
          tessellator.addVertex(-i - 1, -1D, 0.0D);
          tessellator.addVertex(-i - 1, 8D, 0.0D);
          tessellator.addVertex(i + 1, 8D, 0.0D);
          tessellator.addVertex(i + 1, -1D, 0.0D);

          tessellator.draw();
          GL11.glEnable(GL11.GL_TEXTURE_2D);
          GL11.glDepthMask(true);
          fontrenderer.drawString(s, -fontrenderer.getStringWidth(s) / 2, 0, 0x20ffffff);

          GL11.glEnable(GL11.GL_LIGHTING);
          GL11.glDisable(GL11.GL_BLEND);
          GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
          GL11.glPopMatrix();
        }
      }
    }
  }