Exemplo n.º 1
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();
    }
  }
Exemplo n.º 2
0
  /** 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();
  }