コード例 #1
0
ファイル: GuiIngame.java プロジェクト: Jay92/TestClient
 private void renderBossHealth() {
   if (RenderDragon.field_41038_a == null) {
     return;
   }
   EntityDragon entitydragon = RenderDragon.field_41038_a;
   RenderDragon.field_41038_a = null;
   FontRenderer fontrenderer = mc.fontRenderer;
   ScaledResolution scaledresolution =
       new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight);
   int i = scaledresolution.getScaledWidth();
   char c = '\266';
   int j = i / 2 - c / 2;
   int k =
       (int)
           (((float) entitydragon.func_41010_ax() / (float) entitydragon.getMaxHealth())
               * (float) (c + 1));
   byte byte0 = 12;
   drawTexturedModalRect(j, byte0, 0, 74, c, 5);
   drawTexturedModalRect(j, byte0, 0, 74, c, 5);
   if (k > 0) {
     drawTexturedModalRect(j, byte0, 0, 79, k, 5);
   }
   String s = "Boss health";
   fontrenderer.drawStringWithShadow(
       s, i / 2 - fontrenderer.getStringWidth(s) / 2, byte0 - 10, 0xff00ff);
   GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
   GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, mc.renderEngine.getTexture("/gui/icons.png"));
 }
コード例 #2
0
ファイル: GuiIngame.java プロジェクト: ItTotallyHax/src
  /** Renders dragon's (boss) health on the HUD */
  private void renderBossHealth() {
    if (RenderDragon.entityDragon != null) {
      EntityDragon var1 = RenderDragon.entityDragon;
      RenderDragon.entityDragon = null;
      FontRenderer var2 = this.mc.fontRenderer;
      ScaledResolution var3 =
          new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight);
      int var4 = var3.getScaledWidth();
      short var5 = 182;
      int var6 = var4 / 2 - var5 / 2;
      int var7 =
          (int) ((float) var1.getDragonHealth() / (float) var1.getMaxHealth() * (float) (var5 + 1));
      byte var8 = 12;
      this.drawTexturedModalRect(var6, var8, 0, 74, var5, 5);
      this.drawTexturedModalRect(var6, var8, 0, 74, var5, 5);

      if (var7 > 0) {
        this.drawTexturedModalRect(var6, var8, 0, 79, var7, 5);
      }

      String var9 = "Boss health";
      var2.drawStringWithShadow(
          var9, var4 / 2 - var2.getStringWidth(var9) / 2, var8 - 10, 16711935);
      GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
      GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/gui/icons.png"));
    }
  }
コード例 #3
0
 public void render() {
   FontRenderer font = BukkitContrib.getGameInstance().fontRenderer;
   String lines[] = getText().split("\\n");
   for (int i = 0; i < lines.length; i++) {
     font.drawStringWithShadow(
         lines[i],
         getUpperRightX() - (isCentered() ? font.getStringWidth(lines[i]) / 2 : 0),
         getUpperRightY() - (i * 10),
         getHexColor());
   }
 }
コード例 #4
0
  /** 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();
        }
      }
    }
  }
コード例 #5
0
 protected void func_22015_a(
     EntityPlayer p_22015_1_, double p_22015_2_, double p_22015_4_, double p_22015_6_) {
   if (Minecraft.func_22006_t() && p_22015_1_ != this.field_191_a.field_22188_h) {
     float var8 = 1.6F;
     float var9 = 0.016666668F * var8;
     float var10 = p_22015_1_.func_379_d(this.field_191_a.field_22188_h);
     float var11 = p_22015_1_.func_381_o() ? 32.0F : 64.0F;
     if (var10 < var11) {
       String var12 = p_22015_1_.field_771_i;
       if (!p_22015_1_.func_381_o()) {
         if (p_22015_1_.func_22051_K()) {
           this.func_22013_a(p_22015_1_, var12, p_22015_2_, p_22015_4_ - 1.5D, p_22015_6_, 64);
         } else {
           this.func_22013_a(p_22015_1_, var12, p_22015_2_, p_22015_4_, p_22015_6_, 64);
         }
       } else {
         FontRenderer var13 = this.func_6329_a();
         GL11.glPushMatrix();
         GL11.glTranslatef(
             (float) p_22015_2_ + 0.0F, (float) p_22015_4_ + 2.3F, (float) p_22015_6_);
         GL11.glNormal3f(0.0F, 1.0F, 0.0F);
         GL11.glRotatef(-this.field_191_a.field_1225_i, 0.0F, 1.0F, 0.0F);
         GL11.glRotatef(this.field_191_a.field_1224_j, 1.0F, 0.0F, 0.0F);
         GL11.glScalef(-var9, -var9, var9);
         GL11.glDisable(2896);
         GL11.glTranslatef(0.0F, 0.25F / var9, 0.0F);
         GL11.glDepthMask(false);
         GL11.glEnable(3042);
         GL11.glBlendFunc(770, 771);
         Tessellator var14 = Tessellator.field_1512_a;
         GL11.glDisable(3553);
         var14.func_977_b();
         int var15 = var13.func_871_a(var12) / 2;
         var14.func_986_a(0.0F, 0.0F, 0.0F, 0.25F);
         var14.func_991_a((double) (-var15 - 1), -1.0D, 0.0D);
         var14.func_991_a((double) (-var15 - 1), 8.0D, 0.0D);
         var14.func_991_a((double) (var15 + 1), 8.0D, 0.0D);
         var14.func_991_a((double) (var15 + 1), -1.0D, 0.0D);
         var14.func_982_a();
         GL11.glEnable(3553);
         GL11.glDepthMask(true);
         var13.func_873_b(var12, -var13.func_871_a(var12) / 2, 0, 553648127);
         GL11.glEnable(2896);
         GL11.glDisable(3042);
         GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
         GL11.glPopMatrix();
       }
     }
   }
 }
コード例 #6
0
 public ChatClickData(FontRenderer par1FontRenderer, ChatLine par2ChatLine, int par3, int par4) {
   this.fontR = par1FontRenderer;
   this.line = par2ChatLine;
   this.field_50093_d = par3;
   this.field_50094_e = par4;
   this.field_50091_f = par1FontRenderer.trimStringToWidth(par2ChatLine.message, par3);
   this.field_50092_g = this.func_50090_c();
 }
コード例 #7
0
  public void render(int x, int y, int width, int height) {
    MCRenderDelegate r = (MCRenderDelegate) SpoutClient.getInstance().getRenderDelegate();
    FontRenderer font = SpoutClient.getHandle().fontRenderer;

    String sResolution = resolution + "x";
    int sWidth = font.getStringWidth(sResolution);
    font.drawStringWithShadow(sResolution, x + width - sWidth - 2, y + 2, 0xffaaaaaa);

    String name = r.getFittingText(getName(), width - 29 - sWidth - 2 - x);
    font.drawStringWithShadow(name, x + 29, y + 2, 0xffffffff);

    String sStatus = "";
    if (size > 1024 * 1024 * 9000) {
      sStatus = ChatColor.RED + "It's over 9000! ";
    }
    if (size > 1024 * 1024) {
      sStatus += size / (1024 * 1024) + " MB";
    } else if (size > 1024) {
      sStatus = size / 1024 + " KB";
    } else {
      sStatus = size + " Bytes";
    }
    if (isDownloading()) {
      sStatus = "Downloading: " + ChatColor.WHITE + download.getProgress() + "%";
    }
    if (downloadFail != null) {
      sStatus = downloadFail;
    }
    if (installed) {
      sStatus = ChatColor.GREEN + "Installed";
    }
    if (sStatus != null) {
      sWidth = font.getStringWidth(sStatus);
      font.drawStringWithShadow(sStatus, x + width - sWidth - 2, y + 11, 0xffaaaaaa);
    }

    String author = "by " + ChatColor.WHITE + getAuthor();
    author = r.getFittingText(author, width - 29 - sWidth - 2 - x);
    font.drawStringWithShadow(author, x + 29, y + 11, 0xffaaaaaa);

    String desc = r.getFittingText(getDescription(), width - 2 - 29);
    font.drawStringWithShadow(desc, x + 29, y + 20, 0xffaaaaaa);

    String iconUrl = getIconUrl();
    Texture icon = CustomTextureManager.getTextureFromUrl(iconUrl);
    if (icon == null) {
      CustomTextureManager.downloadTexture(iconUrl, true);
    } else {
      GL11.glPushMatrix();
      GL11.glTranslated(x + 2, y + 2, 0);
      r.drawTexture(icon, 25, 25);
      GL11.glPopMatrix();
    }
  }
コード例 #8
0
ファイル: ChatManager.java プロジェクト: nallar/Spoutcraft
  public List<String> formatChat(String message, boolean display) {
    final LinkedList<String> lines = new LinkedList<String>();
    final FontRenderer font = Minecraft.theMinecraft.fontRenderer;
    final int width =
        (int) SpoutClient.getInstance().getActivePlayer().getMainScreen().getChatBar().getWidth()
            - 6;

    if (message.startsWith("/")) {
      if (display) {
        message = completeNames(message);
      }
      if (message.length() > 99) {
        message = message.substring(0, 100);
      }
      lines.add(message);
      return lines;
    }

    if (display) {
      message = completeNames(message);
    }

    StringBuilder builder = new StringBuilder(100);
    int lineWidth = 0;
    for (int i = 0; i < message.length(); i++) {
      char ch = message.charAt(i);
      int charWidth = font.getStringWidth(String.valueOf(ch));
      if (lineWidth + charWidth < width && (display || builder.length() < 99)) {
        builder.append(ch);
        lineWidth += charWidth;
      } else {
        lines.add(builder.toString());
        builder.delete(0, builder.length());
        builder.append(ch);
        lineWidth = charWidth;
      }
    }

    if (builder.length() > 0) {
      lines.add(builder.toString());
    }

    return lines;
  }
コード例 #9
0
  private String func_50090_c() {
    int var1 = this.field_50091_f.lastIndexOf(" ", this.field_50091_f.length()) + 1;

    if (var1 < 0) {
      var1 = 0;
    }

    int var2 = this.line.message.indexOf(" ", var1);

    if (var2 < 0) {
      var2 = this.line.message.length();
    }

    FontRenderer var10000 = this.fontR;
    return FontRenderer.stripColorCodes(this.line.message.substring(var1, var2));
  }
コード例 #10
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();
    }
  }
コード例 #11
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();
  }
コード例 #12
0
ファイル: RenderPlayer.java プロジェクト: Hoeze/Spoutcraft
  /** Used to render a player's name above their head */
  protected void renderName(EntityPlayer par1EntityPlayer, double par2, double par4, double par6) {
    if (!par1EntityPlayer.getHasActivePotion()) {
      if (Minecraft.isGuiEnabled()
          && (par1EntityPlayer != this.renderManager.livingPlayer
              || (Minecraft.theMinecraft.gameSettings.thirdPersonView != 0
                  && Minecraft.theMinecraft.currentScreen == null))) {
        float var8 = 1.6F;
        float var9 = 0.016666668F * var8;
        double var10 = par1EntityPlayer.getDistanceSqToEntity(this.renderManager.livingPlayer);
        float var12 = par1EntityPlayer.isSneaking() ? 32.0F : 64.0F;

        if (var10 < (double) (var12 * var12)) {
          // Spout Start
          String title = null;
          VIP vip = par1EntityPlayer.vip;
          if (vip != null) {
            title = vip.getTitle();
          } else {
            title = par1EntityPlayer.displayName;
          }
          float alpha = 0.25F;
          // If a plugin hasn't set a title, use the easter egg title (if one exists)
          /*if (EasterEggs.getEasterEggTitle(var1.username) != null && color == -1) {
          	title = EasterEggs.getEasterEggTitle(var1.username);
          	alpha = 0.0F;
          }*/
          if (!title.equals("[hide]")) {
            String lines[] = title.split("\\n");
            double y = par4;
            for (int line = 0; line < lines.length; line++) {
              title = lines[line];
              par4 = y + (0.275D * (lines.length - line - 1));

              if (AccessoryHandler.hasAccessory(
                  par1EntityPlayer.username, AccessoryType.NOTCHHAT)) {
                par4 = par4 + 0.275d;
              } else if (AccessoryHandler.hasAccessory(
                  par1EntityPlayer.username, AccessoryType.TOPHAT)) {
                par4 = par4 + 0.5d;
              }

              if (!par1EntityPlayer.isSneaking()) {
                if (par1EntityPlayer.isPlayerSleeping()) {
                  this.renderLivingLabel(par1EntityPlayer, title, par2, par4 - 1.5D, par6, 64);
                } else {
                  this.renderLivingLabel(par1EntityPlayer, title, par2, par4, par6, 64);
                  // TODO: Adapation needed.
                  /*if (color != -1) {
                  	this.renderLivingLabel(var1, title, var2, var4, var6, 64, color, color);
                  } else {
                  	this.renderLivingLabel(par1EntityPlayer, title, par2, par4, par6, 64);
                  }*/
                }
              } else {
                title = org.bukkit.ChatColor.stripColor(title); // strip colors when sneaking
                FontRenderer var14 = this.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(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
                GL11.glRotatef(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
                GL11.glScalef(-var9, -var9, var9);
                GL11.glDisable(GL11.GL_LIGHTING);
                GL11.glTranslatef(0.0F, 0.25F / var9, 0.0F);
                GL11.glDepthMask(false);

                GL11.glEnable(GL11.GL_BLEND);
                GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
                Tessellator var15 = Tessellator.instance;
                GL11.glDisable(GL11.GL_TEXTURE_2D);
                var15.startDrawingQuads();
                int var16 = var14.getStringWidth(title) / 2;
                var15.setColorRGBA_F(0.0F, 0.0F, 0.0F, 0.25F);
                var15.addVertex((double) (-var16 - 1), -1.0D, 0.0D);
                var15.addVertex((double) (-var16 - 1), 8.0D, 0.0D);
                var15.addVertex((double) (var16 + 1), 8.0D, 0.0D);
                var15.addVertex((double) (var16 + 1), -1.0D, 0.0D);
                var15.draw();
                GL11.glEnable(GL11.GL_TEXTURE_2D);
                GL11.glDepthMask(true);
                var14.drawString(title, -var14.getStringWidth(title) / 2, 0, 553648127);
                GL11.glEnable(GL11.GL_LIGHTING);

                GL11.glDisable(GL11.GL_BLEND);
                GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
                GL11.glPopMatrix();
                // Spout End
              }
            }
          }
        }
      }
    }
  }
コード例 #13
0
ファイル: EntityText.java プロジェクト: nallar/Spoutcraft
 private void updateGeometry() {
   FontRenderer font = SpoutClient.getHandle().fontRenderer;
   this.width = (float) font.getStringWidth(text) * 0.0139F * scale;
   this.height = 0.124F * scale;
 }
コード例 #14
0
ファイル: GuiIngame.java プロジェクト: Killili/Spoutcraft
  public void renderGameOverlay(float var1, boolean var2, int var3, int var4) {
    // Spout Start
    SpoutClient.getInstance().onTick();
    InGameHUD mainScreen = SpoutClient.getInstance().getActivePlayer().getMainScreen();
    // Spout End
    ScaledResolution var5 =
        new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight);
    int var6 = var5.getScaledWidth();
    int var7 = var5.getScaledHeight();
    FontRenderer var8 = this.mc.fontRenderer;
    this.mc.entityRenderer.func_905_b();
    GL11.glEnable(3042 /*GL_BLEND*/);
    if (Minecraft.isFancyGraphicsEnabled()) {
      this.renderVignette(this.mc.thePlayer.getEntityBrightness(var1), var6, var7);
    }

    ItemStack var9 = this.mc.thePlayer.inventory.armorItemInSlot(3);
    if (!this.mc.gameSettings.thirdPersonView
        && var9 != null
        && var9.itemID == Block.pumpkin.blockID) {
      this.renderPumpkinBlur(var6, var7);
    }

    float var10 =
        this.mc.thePlayer.prevTimeInPortal
            + (this.mc.thePlayer.timeInPortal - this.mc.thePlayer.prevTimeInPortal) * var1;
    if (var10 > 0.0F) {
      this.renderPortalOverlay(var10, var6, var7);
    }

    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, this.mc.renderEngine.getTexture("/gui/gui.png"));
    InventoryPlayer var11 = this.mc.thePlayer.inventory;
    this.zLevel = -90.0F;
    this.drawTexturedModalRect(var6 / 2 - 91, var7 - 22, 0, 0, 182, 22);
    this.drawTexturedModalRect(
        var6 / 2 - 91 - 1 + var11.currentItem * 20, var7 - 22 - 1, 0, 22, 24, 22);
    GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, this.mc.renderEngine.getTexture("/gui/icons.png"));
    GL11.glEnable(3042 /*GL_BLEND*/);
    GL11.glBlendFunc(775, 769);
    this.drawTexturedModalRect(var6 / 2 - 7, var7 / 2 - 7, 0, 0, 16, 16);
    GL11.glDisable(3042 /*GL_BLEND*/);
    boolean var12 = this.mc.thePlayer.heartsLife / 3 % 2 == 1;
    if (this.mc.thePlayer.heartsLife < 10) {
      var12 = false;
    }

    int var13 = this.mc.thePlayer.health;
    int var14 = this.mc.thePlayer.prevHealth;
    this.rand.setSeed((long) (this.updateCounter * 312871));
    int var15;
    int var17;
    int var16;
    if (this.mc.playerController.shouldDrawHUD()) {
      var15 = this.mc.thePlayer.getPlayerArmorValue();

      int var18;
      for (var16 = 0; var16 < 10; ++var16) {
        var17 = var7 - 32;
        // Spout Start
        if (mainScreen.getArmorBar().isVisible()) {
          if (var15 > 0) {
            var18 = var6 / 2 + 91 - var16 * 8 - 9;
            if (var16 * 2 + 1 < var15) {
              this.drawTexturedModalRect(var18, var17, 34, 9, 9, 9);
            }

            if (var16 * 2 + 1 == var15) {
              this.drawTexturedModalRect(var18, var17, 25, 9, 9, 9);
            }

            if (var16 * 2 + 1 > var15) {
              this.drawTexturedModalRect(var18, var17, 16, 9, 9, 9);
            }
          }
        }
        // Spout End
        byte var31 = 0;
        if (var12) {
          var31 = 1;
        }

        int var19 = var6 / 2 - 91 + var16 * 8;
        if (var13 <= 4) {
          var17 += this.rand.nextInt(2);
        }
        // Spout Start
        if (mainScreen.getHealthBar().isVisible()) {
          this.drawTexturedModalRect(var19, var17, 16 + var31 * 9, 0, 9, 9);
          if (var12) {
            if (var16 * 2 + 1 < var14) {
              this.drawTexturedModalRect(var19, var17, 70, 0, 9, 9);
            }
            if (var16 * 2 + 1 == var14) {
              this.drawTexturedModalRect(var19, var17, 79, 0, 9, 9);
            }
          }

          if (var16 * 2 + 1 < var13) {
            this.drawTexturedModalRect(var19, var17, 52, 0, 9, 9);
          }

          if (var16 * 2 + 1 == var13) {
            this.drawTexturedModalRect(var19, var17, 61, 0, 9, 9);
          }
        }
        // Spout End
      }

      if (this.mc.thePlayer.isInsideOfMaterial(Material.water)) {
        // Spout Start
        var16 =
            (int) Math.ceil(((double) (mc.thePlayer.air - 2) * 10D) / (mc.thePlayer.maxAir * 1D));
        var17 =
            (int) Math.ceil(((double) mc.thePlayer.air * 10D) / (mc.thePlayer.maxAir * 1D)) - var16;
        if (mainScreen.getBubbleBar().isVisible()) {
          for (var18 = 0; var18 < var16 + var17; ++var18) {
            if (var18 < var16) {
              this.drawTexturedModalRect(var6 / 2 - 91 + var18 * 8, var7 - 32 - 9, 16, 18, 9, 9);
            } else {
              this.drawTexturedModalRect(var6 / 2 - 91 + var18 * 8, var7 - 32 - 9, 25, 18, 9, 9);
            }
          }
        }
        // Spout End
      }
    }

    GL11.glDisable(3042 /*GL_BLEND*/);
    GL11.glEnable('\u803a');
    GL11.glPushMatrix();
    GL11.glRotatef(120.0F, 1.0F, 0.0F, 0.0F);
    RenderHelper.enableStandardItemLighting();
    GL11.glPopMatrix();

    for (var15 = 0; var15 < 9; ++var15) {
      var16 = var6 / 2 - 90 + var15 * 20 + 2;
      var17 = var7 - 16 - 3;
      this.renderInventorySlot(var15, var16, var17, var1);
    }

    RenderHelper.disableStandardItemLighting();
    GL11.glDisable('\u803a');
    if (this.mc.thePlayer.func_22060_M() > 0) {
      GL11.glDisable(2929 /*GL_DEPTH_TEST*/);
      GL11.glDisable(3008 /*GL_ALPHA_TEST*/);
      var15 = this.mc.thePlayer.func_22060_M();
      float var26 = (float) var15 / 100.0F;
      if (var26 > 1.0F) {
        var26 = 1.0F - (float) (var15 - 100) / 10.0F;
      }

      var17 = (int) (220.0F * var26) << 24 | 1052704;
      this.drawRect(0, 0, var6, var7, var17);
      GL11.glEnable(3008 /*GL_ALPHA_TEST*/);
      GL11.glEnable(2929 /*GL_DEPTH_TEST*/);
    }
    // Spout Start
    mainScreen.render();
    // Spout End
    String var23;
    if (this.mc.gameSettings.showDebugInfo) {
      GL11.glPushMatrix();
      if (Minecraft.hasPaidCheckTime > 0L) {
        GL11.glTranslatef(0.0F, 32.0F, 0.0F);
      }

      var8.drawStringWithShadow("Minecraft Beta 1.7.3 (" + this.mc.debug + ")", 2, 2, 16777215);
      var8.drawStringWithShadow(this.mc.func_6241_m(), 2, 12, 16777215);
      var8.drawStringWithShadow(this.mc.func_6262_n(), 2, 22, 16777215);
      var8.drawStringWithShadow(this.mc.func_6245_o(), 2, 32, 16777215);
      var8.drawStringWithShadow(this.mc.func_21002_o(), 2, 42, 16777215);
      long var25 = Runtime.getRuntime().maxMemory();
      long var30 = Runtime.getRuntime().totalMemory();
      long var29 = Runtime.getRuntime().freeMemory();
      long var21 = var30 - var29;
      var23 =
          "Used memory: "
              + var21 * 100L / var25
              + "% ("
              + var21 / 1024L / 1024L
              + "MB) of "
              + var25 / 1024L / 1024L
              + "MB";
      this.drawString(var8, var23, var6 - var8.getStringWidth(var23) - 2, 2, 14737632);
      var23 = "Allocated memory: " + var30 * 100L / var25 + "% (" + var30 / 1024L / 1024L + "MB)";
      this.drawString(var8, var23, var6 - var8.getStringWidth(var23) - 2, 12, 14737632);
      // Spout Start
      // No Cheating!
      if (SpoutClient.getInstance().isCheatMode()) {
        this.drawString(var8, "x: " + this.mc.thePlayer.posX, 2, 64, 14737632);
        this.drawString(var8, "y: " + this.mc.thePlayer.posY, 2, 72, 14737632);
        this.drawString(var8, "z: " + this.mc.thePlayer.posZ, 2, 80, 14737632);
        this.drawString(
            var8,
            "f: "
                + (MathHelper.floor_double(
                        (double) (this.mc.thePlayer.rotationYaw * 4.0F / 360.0F) + 0.5D)
                    & 3),
            2,
            88,
            14737632);
      }
      // Spout End
      // Spout Start
      this.drawString(var8, "Map Data Info", 2, 64, 14737632);
      this.drawString(
          var8,
          "Average packet size: " + ChunkCache.averageChunkSize.get() + " bytes",
          2,
          72,
          14737632);
      this.drawString(
          var8, "Cache hit percent: " + ChunkCache.hitPercentage.get(), 2, 80, 14737632);
      // Spout end
      GL11.glPopMatrix();
    }

    if (this.recordPlayingUpFor > 0) {
      float var24 = (float) this.recordPlayingUpFor - var1;
      var16 = (int) (var24 * 256.0F / 20.0F);
      if (var16 > 255) {
        var16 = 255;
      }

      if (var16 > 0) {
        GL11.glPushMatrix();
        GL11.glTranslatef((float) (var6 / 2), (float) (var7 - 48), 0.0F);
        GL11.glEnable(3042 /*GL_BLEND*/);
        GL11.glBlendFunc(770, 771);
        var17 = 16777215;
        if (this.field_22065_l) {
          var17 = Color.HSBtoRGB(var24 / 50.0F, 0.7F, 0.6F) & 16777215;
        }

        var8.drawString(
            this.recordPlaying,
            -var8.getStringWidth(this.recordPlaying) / 2,
            -4,
            var17 + (var16 << 24));
        GL11.glDisable(3042 /*GL_BLEND*/);
        GL11.glPopMatrix();
      }
    }

    byte var27 = 10;
    boolean var28 = false;
    // Spout Start
    if (mainScreen.getChatBar().isVisible()) {
      if (mc.currentScreen instanceof GuiChat) {
        var27 = 20;
        var28 = true;
      }
    }
    boolean chatOpen = var28;
    int lines =
        chatOpen
            ? mainScreen.getChatTextBox().getNumVisibleChatLines()
            : mainScreen.getChatTextBox().getNumVisibleLines();
    // Spout End

    GL11.glEnable(3042 /*GL_BLEND*/);
    GL11.glBlendFunc(770, 771);
    GL11.glDisable(3008 /*GL_ALPHA_TEST*/);
    GL11.glPushMatrix();
    GL11.glTranslatef(0.0F, (float) (var7 - 48), 0.0F);

    // Spout Start

    if (mainScreen.getChatTextBox().isVisible()) {
      Math.max(
          0,
          chatMessageList.size()
              - SpoutClient.getInstance().getChatManager().chatScroll
              - 1
              - var27);
      int viewedLine = 0;

      for (int line = SpoutClient.getInstance().getChatManager().chatScroll;
          line
              < Math.min(
                  chatMessageList.size() - 1,
                  (lines + SpoutClient.getInstance().getChatManager().chatScroll));
          line++) {
        if (chatOpen || chatMessageList.get(line).updateCounter < 250) {
          double opacity = 1.0D - chatMessageList.get(line).updateCounter / 250D;
          opacity *= 10D;
          if (opacity < 0.0D) {
            opacity = 0.0D;
          }
          if (opacity > 1.0D) {
            opacity = 1.0D;
          }
          opacity *= opacity;
          int color = chatOpen ? 255 : (int) (255D * opacity);
          if (color > 0) {
            int height = 2;
            int width = -viewedLine * 9;
            String chat = chatMessageList.get(line).message;
            chat = SpoutClient.getInstance().getChatManager().formatChatColors(chat);
            chat = ChatManager.formatUrl(chat);
            // TODO add support for opening URL in browser if clicked?
            drawRect(height, width - 1, height + 320, width + 8, color / 2 << 24);
            GL11.glEnable(3042 /*GL_BLEND*/);
            var8.drawStringWithShadow(chat, height, width, 0xffffff + (color << 24));
          }
          viewedLine++;
        }
      }
    }
    // Spout End

    GL11.glPopMatrix();
    GL11.glEnable(3008 /*GL_ALPHA_TEST*/);
    GL11.glDisable(3042 /*GL_BLEND*/);
  }
コード例 #15
0
  protected void func_74185_a(float p_74185_1_, int p_74185_2_, int p_74185_3_) {
    int var4 = this.field_73882_e.field_71446_o.func_78341_b("/gui/enchant.png");
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    this.field_73882_e.field_71446_o.func_78342_b(var4);
    int var5 = (this.field_73880_f - this.field_74194_b) / 2;
    int var6 = (this.field_73881_g - this.field_74195_c) / 2;
    this.func_73729_b(var5, var6, 0, 0, this.field_74194_b, this.field_74195_c);
    GL11.glPushMatrix();
    GL11.glMatrixMode(5889);
    GL11.glPushMatrix();
    GL11.glLoadIdentity();
    ScaledResolution var7 =
        new ScaledResolution(
            this.field_73882_e.field_71474_y,
            this.field_73882_e.field_71443_c,
            this.field_73882_e.field_71440_d);
    GL11.glViewport(
        (var7.func_78326_a() - 320) / 2 * var7.func_78325_e(),
        (var7.func_78328_b() - 240) / 2 * var7.func_78325_e(),
        320 * var7.func_78325_e(),
        240 * var7.func_78325_e());
    GL11.glTranslatef(-0.34F, 0.23F, 0.0F);
    GLU.gluPerspective(90.0F, 1.3333334F, 9.0F, 80.0F);
    float var8 = 1.0F;
    GL11.glMatrixMode(5888);
    GL11.glLoadIdentity();
    RenderHelper.func_74519_b();
    GL11.glTranslatef(0.0F, 3.3F, -16.0F);
    GL11.glScalef(var8, var8, var8);
    float var9 = 5.0F;
    GL11.glScalef(var9, var9, var9);
    GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
    this.field_73882_e.field_71446_o.func_78342_b(
        this.field_73882_e.field_71446_o.func_78341_b("/item/book.png"));
    GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F);
    float var10 = this.field_74208_u + (this.field_74209_t - this.field_74208_u) * p_74185_1_;
    GL11.glTranslatef((1.0F - var10) * 0.2F, (1.0F - var10) * 0.1F, (1.0F - var10) * 0.25F);
    GL11.glRotatef(-(1.0F - var10) * 90.0F - 90.0F, 0.0F, 1.0F, 0.0F);
    GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F);
    float var11 =
        this.field_74212_q + (this.field_74213_p - this.field_74212_q) * p_74185_1_ + 0.25F;
    float var12 =
        this.field_74212_q + (this.field_74213_p - this.field_74212_q) * p_74185_1_ + 0.75F;
    var11 = (var11 - (float) MathHelper.func_76140_b((double) var11)) * 1.6F - 0.3F;
    var12 = (var12 - (float) MathHelper.func_76140_b((double) var12)) * 1.6F - 0.3F;
    if (var11 < 0.0F) {
      var11 = 0.0F;
    }

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

    if (var11 > 1.0F) {
      var11 = 1.0F;
    }

    if (var12 > 1.0F) {
      var12 = 1.0F;
    }

    GL11.glEnable('\u803a');
    field_74206_w.func_78088_a((Entity) null, 0.0F, var11, var12, var10, 0.0F, 0.0625F);
    GL11.glDisable('\u803a');
    RenderHelper.func_74518_a();
    GL11.glMatrixMode(5889);
    GL11.glViewport(0, 0, this.field_73882_e.field_71443_c, this.field_73882_e.field_71440_d);
    GL11.glPopMatrix();
    GL11.glMatrixMode(5888);
    GL11.glPopMatrix();
    RenderHelper.func_74518_a();
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    this.field_73882_e.field_71446_o.func_78342_b(var4);
    EnchantmentNameParts.field_78061_a.func_78058_a(this.field_74215_y.field_75166_f);

    for (int var13 = 0; var13 < 3; ++var13) {
      String var14 = EnchantmentNameParts.field_78061_a.func_78057_a();
      this.field_73735_i = 0.0F;
      this.field_73882_e.field_71446_o.func_78342_b(var4);
      int var15 = this.field_74215_y.field_75167_g[var13];
      GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
      if (var15 == 0) {
        this.func_73729_b(var5 + 60, var6 + 14 + 19 * var13, 0, 185, 108, 19);
      } else {
        String var16 = "" + var15;
        FontRenderer var17 = this.field_73882_e.field_71464_q;
        int var18 = 6839882;
        if (this.field_73882_e.field_71439_g.field_71068_ca < var15
            && !this.field_73882_e.field_71439_g.field_71075_bZ.field_75098_d) {
          this.func_73729_b(var5 + 60, var6 + 14 + 19 * var13, 0, 185, 108, 19);
          var17.func_78279_b(
              var14, var5 + 62, var6 + 16 + 19 * var13, 104, (var18 & 16711422) >> 1);
          var17 = this.field_73882_e.field_71466_p;
          var18 = 4226832;
          var17.func_78261_a(
              var16,
              var5 + 62 + 104 - var17.func_78256_a(var16),
              var6 + 16 + 19 * var13 + 7,
              var18);
        } else {
          int var19 = p_74185_2_ - (var5 + 60);
          int var20 = p_74185_3_ - (var6 + 14 + 19 * var13);
          if (var19 >= 0 && var20 >= 0 && var19 < 108 && var20 < 19) {
            this.func_73729_b(var5 + 60, var6 + 14 + 19 * var13, 0, 204, 108, 19);
            var18 = 16777088;
          } else {
            this.func_73729_b(var5 + 60, var6 + 14 + 19 * var13, 0, 166, 108, 19);
          }

          var17.func_78279_b(var14, var5 + 62, var6 + 16 + 19 * var13, 104, var18);
          var17 = this.field_73882_e.field_71466_p;
          var18 = 8453920;
          var17.func_78261_a(
              var16,
              var5 + 62 + 104 - var17.func_78256_a(var16),
              var6 + 16 + 19 * var13 + 7,
              var18);
        }
      }
    }
  }
コード例 #16
0
ファイル: GuiIngame.java プロジェクト: Jay92/TestClient
  public void renderGameOverlay(float f, boolean flag, int i, int j) {
    ScaledResolution scaledresolution =
        new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight);
    int k = scaledresolution.getScaledWidth();
    int l = scaledresolution.getScaledHeight();
    FontRenderer fontrenderer = mc.fontRenderer;
    mc.entityRenderer.setupOverlayRendering();
    GL11.glEnable(3042 /*GL_BLEND*/);
    if (Minecraft.isFancyGraphicsEnabled()) {
      renderVignette(mc.thePlayer.getEntityBrightness(f), k, l);
    } else {
      GL11.glBlendFunc(770, 771);
    }
    ItemStack itemstack = mc.thePlayer.inventory.armorItemInSlot(3);
    if (mc.gameSettings.thirdPersonView == 0
        && itemstack != null
        && itemstack.itemID == Block.pumpkin.blockID) {
      renderPumpkinBlur(k, l);
    }
    if (!mc.thePlayer.isPotionActive(Potion.confusion)) {
      float f1 =
          mc.thePlayer.prevTimeInPortal
              + (mc.thePlayer.timeInPortal - mc.thePlayer.prevTimeInPortal) * f;
      if (f1 > 0.0F) {
        renderPortalOverlay(f1, k, l);
      }
    }
    if (!mc.playerController.func_35643_e()) {
      GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
      GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, mc.renderEngine.getTexture("/gui/gui.png"));
      InventoryPlayer inventoryplayer = mc.thePlayer.inventory;
      zLevel = -90F;
      drawTexturedModalRect(k / 2 - 91, l - 22, 0, 0, 182, 22);
      drawTexturedModalRect(
          (k / 2 - 91 - 1) + inventoryplayer.currentItem * 20, l - 22 - 1, 0, 22, 24, 22);
      GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, mc.renderEngine.getTexture("/gui/icons.png"));
      GL11.glEnable(3042 /*GL_BLEND*/);
      GL11.glBlendFunc(775, 769);
      drawTexturedModalRect(k / 2 - 7, l / 2 - 7, 0, 0, 16, 16);
      GL11.glDisable(3042 /*GL_BLEND*/);
      boolean flag2 = (mc.thePlayer.heartsLife / 3) % 2 == 1;
      if (mc.thePlayer.heartsLife < 10) {
        flag2 = false;
      }
      int i2 = mc.thePlayer.getEntityHealth();
      int j3 = mc.thePlayer.prevHealth;
      rand.setSeed(updateCounter * 0x4c627);
      boolean flag4 = false;
      FoodStats foodstats = mc.thePlayer.getFoodStats();
      int i5 = foodstats.getFoodLevel();
      int k5 = foodstats.getPrevFoodLevel();
      renderBossHealth();
      if (mc.playerController.shouldDrawHUD()) {
        int k6 = k / 2 - 91;
        int j7 = k / 2 + 91;
        int l7 = mc.thePlayer.xpBarCap();
        if (l7 > 0) {
          char c = '\266';
          int i9 = (int) (mc.thePlayer.currentXP * (float) (c + 1));
          int l9 = (l - 32) + 3;
          drawTexturedModalRect(k6, l9, 0, 64, c, 5);
          if (i9 > 0) {
            drawTexturedModalRect(k6, l9, 0, 69, i9, 5);
          }
        }
        int k8 = l - 39;
        int j9 = k8 - 10;
        int i10 = mc.thePlayer.getPlayerArmorValue();
        int j10 = -1;
        if (mc.thePlayer.isPotionActive(Potion.regeneration)) {
          j10 = updateCounter % 25;
        }
        for (int l10 = 0; l10 < 10; l10++) {
          if (i10 > 0) {
            int k11 = k6 + l10 * 8;
            if (l10 * 2 + 1 < i10) {
              drawTexturedModalRect(k11, j9, 34, 9, 9, 9);
            }
            if (l10 * 2 + 1 == i10) {
              drawTexturedModalRect(k11, j9, 25, 9, 9, 9);
            }
            if (l10 * 2 + 1 > i10) {
              drawTexturedModalRect(k11, j9, 16, 9, 9, 9);
            }
          }
          int l11 = 16;
          if (mc.thePlayer.isPotionActive(Potion.poison)) {
            l11 += 36;
          }
          int k12 = 0;
          if (flag2) {
            k12 = 1;
          }
          int j13 = k6 + l10 * 8;
          int k13 = k8;
          if (i2 <= 4) {
            k13 += rand.nextInt(2);
          }
          if (l10 == j10) {
            k13 -= 2;
          }
          byte byte5 = 0;
          if (mc.theWorld.getWorldInfo().isHardcoreModeEnabled()) {
            byte5 = 5;
          }
          drawTexturedModalRect(j13, k13, 16 + k12 * 9, 9 * byte5, 9, 9);
          if (flag2) {
            if (l10 * 2 + 1 < j3) {
              drawTexturedModalRect(j13, k13, l11 + 54, 9 * byte5, 9, 9);
            }
            if (l10 * 2 + 1 == j3) {
              drawTexturedModalRect(j13, k13, l11 + 63, 9 * byte5, 9, 9);
            }
          }
          if (l10 * 2 + 1 < i2) {
            drawTexturedModalRect(j13, k13, l11 + 36, 9 * byte5, 9, 9);
          }
          if (l10 * 2 + 1 == i2) {
            drawTexturedModalRect(j13, k13, l11 + 45, 9 * byte5, 9, 9);
          }
        }

        for (int i11 = 0; i11 < 10; i11++) {
          int i12 = k8;
          int l12 = 16;
          byte byte4 = 0;
          if (mc.thePlayer.isPotionActive(Potion.hunger)) {
            l12 += 36;
            byte4 = 13;
          }
          if (mc.thePlayer.getFoodStats().getFoodSaturationLevel() <= 0.0F
              && updateCounter % (i5 * 3 + 1) == 0) {
            i12 += rand.nextInt(3) - 1;
          }
          if (flag4) {
            byte4 = 1;
          }
          int l13 = j7 - i11 * 8 - 9;
          drawTexturedModalRect(l13, i12, 16 + byte4 * 9, 27, 9, 9);
          if (flag4) {
            if (i11 * 2 + 1 < k5) {
              drawTexturedModalRect(l13, i12, l12 + 54, 27, 9, 9);
            }
            if (i11 * 2 + 1 == k5) {
              drawTexturedModalRect(l13, i12, l12 + 63, 27, 9, 9);
            }
          }
          if (i11 * 2 + 1 < i5) {
            drawTexturedModalRect(l13, i12, l12 + 36, 27, 9, 9);
          }
          if (i11 * 2 + 1 == i5) {
            drawTexturedModalRect(l13, i12, l12 + 45, 27, 9, 9);
          }
        }

        if (mc.thePlayer.isInsideOfMaterial(Material.water)) {
          int j11 = (int) Math.ceil(((double) (mc.thePlayer.getAir() - 2) * 10D) / 300D);
          int j12 = (int) Math.ceil(((double) mc.thePlayer.getAir() * 10D) / 300D) - j11;
          for (int i13 = 0; i13 < j11 + j12; i13++) {
            if (i13 < j11) {
              drawTexturedModalRect(j7 - i13 * 8 - 9, j9, 16, 18, 9, 9);
            } else {
              drawTexturedModalRect(j7 - i13 * 8 - 9, j9, 25, 18, 9, 9);
            }
          }
        }
      }
      GL11.glDisable(3042 /*GL_BLEND*/);
      GL11.glEnable(32826 /*GL_RESCALE_NORMAL_EXT*/);
      RenderHelper.func_41089_c();
      for (int l6 = 0; l6 < 9; l6++) {
        int k7 = (k / 2 - 90) + l6 * 20 + 2;
        int i8 = l - 16 - 3;
        renderInventorySlot(l6, k7, i8, f);
      }

      RenderHelper.disableStandardItemLighting();
      GL11.glDisable(32826 /*GL_RESCALE_NORMAL_EXT*/);
    }
    if (mc.thePlayer.getSleepTimer() > 0) {
      GL11.glDisable(2929 /*GL_DEPTH_TEST*/);
      GL11.glDisable(3008 /*GL_ALPHA_TEST*/);
      int i1 = mc.thePlayer.getSleepTimer();
      float f3 = (float) i1 / 100F;
      if (f3 > 1.0F) {
        f3 = 1.0F - (float) (i1 - 100) / 10F;
      }
      int j2 = (int) (220F * f3) << 24 | 0x101020;
      drawRect(0, 0, k, l, j2);
      GL11.glEnable(3008 /*GL_ALPHA_TEST*/);
      GL11.glEnable(2929 /*GL_DEPTH_TEST*/);
    }
    if (mc.playerController.func_35642_f() && mc.thePlayer.playerLevel > 0) {
      boolean flag1 = false;
      int j1 = flag1 ? 0xffffff : 0x80ff20;
      String s = (new StringBuilder()).append("").append(mc.thePlayer.playerLevel).toString();
      int k3 = (k - fontrenderer.getStringWidth(s)) / 2;
      int l3 = l - 31 - 4;
      fontrenderer.drawString(s, k3 + 1, l3, 0);
      fontrenderer.drawString(s, k3 - 1, l3, 0);
      fontrenderer.drawString(s, k3, l3 + 1, 0);
      fontrenderer.drawString(s, k3, l3 - 1, 0);
      fontrenderer.drawString(s, k3, l3, j1);
    }
    if (mc.gameSettings.showDebugInfo) {
      GL11.glPushMatrix();
      if (Minecraft.hasPaidCheckTime > 0L) {
        GL11.glTranslatef(0.0F, 32F, 0.0F);
      }
      fontrenderer.drawStringWithShadow(
          (new StringBuilder()).append("Minecraft 1.0.0 (").append(mc.debug).append(")").toString(),
          2,
          2,
          0xffffff);
      fontrenderer.drawStringWithShadow(mc.debugInfoRenders(), 2, 12, 0xffffff);
      fontrenderer.drawStringWithShadow(mc.func_6262_n(), 2, 22, 0xffffff);
      fontrenderer.drawStringWithShadow(mc.debugInfoEntities(), 2, 32, 0xffffff);
      fontrenderer.drawStringWithShadow(mc.func_21002_o(), 2, 42, 0xffffff);
      long l1 = Runtime.getRuntime().maxMemory();
      long l2 = Runtime.getRuntime().totalMemory();
      long l4 = Runtime.getRuntime().freeMemory();
      long l5 = l2 - l4;
      String s1 =
          (new StringBuilder())
              .append("Used memory: ")
              .append((l5 * 100L) / l1)
              .append("% (")
              .append(l5 / 1024L / 1024L)
              .append("MB) of ")
              .append(l1 / 1024L / 1024L)
              .append("MB")
              .toString();
      drawString(fontrenderer, s1, k - fontrenderer.getStringWidth(s1) - 2, 2, 0xe0e0e0);
      s1 =
          (new StringBuilder())
              .append("Allocated memory: ")
              .append((l2 * 100L) / l1)
              .append("% (")
              .append(l2 / 1024L / 1024L)
              .append("MB)")
              .toString();
      drawString(fontrenderer, s1, k - fontrenderer.getStringWidth(s1) - 2, 12, 0xe0e0e0);
      drawString(
          fontrenderer,
          (new StringBuilder()).append("x: ").append(mc.thePlayer.posX).toString(),
          2,
          64,
          0xe0e0e0);
      drawString(
          fontrenderer,
          (new StringBuilder()).append("y: ").append(mc.thePlayer.posY).toString(),
          2,
          72,
          0xe0e0e0);
      drawString(
          fontrenderer,
          (new StringBuilder()).append("z: ").append(mc.thePlayer.posZ).toString(),
          2,
          80,
          0xe0e0e0);
      drawString(
          fontrenderer,
          (new StringBuilder())
              .append("f: ")
              .append(
                  MathHelper.floor_double((double) ((mc.thePlayer.rotationYaw * 4F) / 360F) + 0.5D)
                      & 3)
              .toString(),
          2,
          88,
          0xe0e0e0);
      drawString(
          fontrenderer,
          (new StringBuilder()).append("Seed: ").append(mc.theWorld.getWorldSeed()).toString(),
          2,
          104,
          0xe0e0e0);
      GL11.glPopMatrix();
    }
    if (recordPlayingUpFor > 0) {
      float f2 = (float) recordPlayingUpFor - f;
      int k1 = (int) ((f2 * 256F) / 20F);
      if (k1 > 255) {
        k1 = 255;
      }
      if (k1 > 0) {
        GL11.glPushMatrix();
        GL11.glTranslatef(k / 2, l - 48, 0.0F);
        GL11.glEnable(3042 /*GL_BLEND*/);
        GL11.glBlendFunc(770, 771);
        int k2 = 0xffffff;
        if (recordIsPlaying) {
          k2 = Color.HSBtoRGB(f2 / 50F, 0.7F, 0.6F) & 0xffffff;
        }
        fontrenderer.drawString(
            recordPlaying, -fontrenderer.getStringWidth(recordPlaying) / 2, -4, k2 + (k1 << 24));
        GL11.glDisable(3042 /*GL_BLEND*/);
        GL11.glPopMatrix();
      }
    }
    byte byte0 = 10;
    boolean flag3 = false;
    if (mc.currentScreen instanceof GuiChat) {
      byte0 = 20;
      flag3 = true;
    }
    GL11.glEnable(3042 /*GL_BLEND*/);
    GL11.glBlendFunc(770, 771);
    GL11.glDisable(3008 /*GL_ALPHA_TEST*/);
    GL11.glPushMatrix();
    GL11.glTranslatef(0.0F, l - 48, 0.0F);
    for (int i3 = 0; i3 < chatMessageList.size() && i3 < byte0; i3++) {
      if (((ChatLine) chatMessageList.get(i3)).updateCounter >= 200 && !flag3) {
        continue;
      }
      double d = (double) ((ChatLine) chatMessageList.get(i3)).updateCounter / 200D;
      d = 1.0D - d;
      d *= 10D;
      if (d < 0.0D) {
        d = 0.0D;
      }
      if (d > 1.0D) {
        d = 1.0D;
      }
      d *= d;
      int j4 = (int) (255D * d);
      if (flag3) {
        j4 = 255;
      }
      if (j4 > 0) {
        byte byte1 = 2;
        int i6 = -i3 * 9;
        String s2 = ((ChatLine) chatMessageList.get(i3)).message;
        drawRect(byte1, i6 - 1, byte1 + 320, i6 + 8, j4 / 2 << 24);
        GL11.glEnable(3042 /*GL_BLEND*/);
        fontrenderer.drawStringWithShadow(s2, byte1, i6, 0xffffff + (j4 << 24));
      }
    }

    GL11.glPopMatrix();
    if ((mc.thePlayer instanceof EntityClientPlayerMP)
        && mc.gameSettings.keyBindPlayerList.pressed) {
      NetClientHandler netclienthandler = ((EntityClientPlayerMP) mc.thePlayer).sendQueue;
      java.util.List list = netclienthandler.playerNames;
      int i4 = netclienthandler.currentServerMaxPlayers;
      int k4 = i4;
      int j5 = 1;
      for (; k4 > 20; k4 = ((i4 + j5) - 1) / j5) {
        j5++;
      }

      int j6 = 300 / j5;
      if (j6 > 150) {
        j6 = 150;
      }
      int i7 = (k - j5 * j6) / 2;
      byte byte2 = 10;
      drawRect(i7 - 1, byte2 - 1, i7 + j6 * j5, byte2 + 9 * k4, 0x80000000);
      for (int j8 = 0; j8 < i4; j8++) {
        int l8 = i7 + (j8 % j5) * j6;
        int k9 = byte2 + (j8 / j5) * 9;
        drawRect(l8, k9, (l8 + j6) - 1, k9 + 8, 0x20ffffff);
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        GL11.glEnable(3008 /*GL_ALPHA_TEST*/);
        if (j8 >= list.size()) {
          continue;
        }
        GuiSavingLevelString guisavinglevelstring = (GuiSavingLevelString) list.get(j8);
        fontrenderer.drawStringWithShadow(guisavinglevelstring.stringValue, l8, k9, 0xffffff);
        mc.renderEngine.bindTexture(mc.renderEngine.getTexture("/gui/icons.png"));
        int k10 = 0;
        byte byte3 = 0;
        k10 = 0;
        byte3 = 0;
        if (guisavinglevelstring.responseTime < 0) {
          byte3 = 5;
        } else if (guisavinglevelstring.responseTime < 150) {
          byte3 = 0;
        } else if (guisavinglevelstring.responseTime < 300) {
          byte3 = 1;
        } else if (guisavinglevelstring.responseTime < 600) {
          byte3 = 2;
        } else if (guisavinglevelstring.responseTime < 1000) {
          byte3 = 3;
        } else {
          byte3 = 4;
        }
        zLevel += 100F;
        drawTexturedModalRect((l8 + j6) - 12, k9, 0 + k10 * 10, 176 + byte3 * 8, 10, 8);
        zLevel -= 100F;
      }
    }
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glDisable(2896 /*GL_LIGHTING*/);
    GL11.glEnable(3008 /*GL_ALPHA_TEST*/);
  }
コード例 #17
0
ファイル: GuiIngame.java プロジェクト: ItTotallyHax/src
  /** Render the ingame overlay with quick icon bar, ... */
  public void renderGameOverlay(float par1, boolean par2, int par3, int par4) {
    ScaledResolution var5 =
        new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight);
    AxiomWrapper.scaledGui = var5;
    int var6 = var5.getScaledWidth();
    int var7 = var5.getScaledHeight();
    FontRenderer var8 = this.mc.fontRenderer;
    this.mc.entityRenderer.setupOverlayRendering();
    GL11.glEnable(GL11.GL_BLEND);

    if (Minecraft.isFancyGraphicsEnabled()) {
      this.renderVignette(this.mc.thePlayer.getBrightness(par1), var6, var7);
    } else {
      GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    }

    ItemStack var9 = this.mc.thePlayer.inventory.armorItemInSlot(3);

    if (this.mc.gameSettings.thirdPersonView == 0
        && var9 != null
        && var9.itemID == Block.pumpkin.blockID) {
      this.renderPumpkinBlur(var6, var7);
    }

    if (!this.mc.thePlayer.isPotionActive(Potion.confusion)) {
      float var10 =
          this.mc.thePlayer.prevTimeInPortal
              + (this.mc.thePlayer.timeInPortal - this.mc.thePlayer.prevTimeInPortal) * par1;

      if (var10 > 0.0F) {
        this.renderPortalOverlay(var10, var6, var7);
      }
    }

    int var11;
    int var12;
    int var13;
    int var14;
    int var15;
    int var17;
    int var16;
    int var19;
    int var18;
    byte var30;
    boolean var33;

    if (!this.mc.playerController.func_78747_a()) {
      GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
      GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/gui/gui.png"));
      InventoryPlayer var20 = this.mc.thePlayer.inventory;
      this.zLevel = -90.0F;
      this.drawTexturedModalRect(var6 / 2 - 91, var7 - 22, 0, 0, 182, 22);
      this.drawTexturedModalRect(
          var6 / 2 - 91 - 1 + var20.currentItem * 20, var7 - 22 - 1, 0, 22, 24, 22);
      GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/gui/icons.png"));
      GL11.glEnable(GL11.GL_BLEND);
      GL11.glBlendFunc(GL11.GL_ONE_MINUS_DST_COLOR, GL11.GL_ONE_MINUS_SRC_COLOR);
      this.drawTexturedModalRect(var6 / 2 - 7, var7 / 2 - 7, 0, 0, 16, 16);
      GL11.glDisable(GL11.GL_BLEND);
      var33 = this.mc.thePlayer.hurtResistantTime / 3 % 2 == 1;

      if (this.mc.thePlayer.hurtResistantTime < 10) {
        var33 = false;
      }

      var11 = this.mc.thePlayer.getHealth();
      var12 = this.mc.thePlayer.prevHealth;
      this.rand.setSeed((long) (this.updateCounter * 312871));
      boolean var21 = false;
      FoodStats var22 = this.mc.thePlayer.getFoodStats();
      var14 = var22.getFoodLevel();
      var13 = var22.getPrevFoodLevel();
      this.mc.mcProfiler.startSection("bossHealth");
      this.renderBossHealth();
      this.mc.mcProfiler.endSection();
      int var23;

      if (this.mc.playerController.shouldDrawHUD()) {
        var23 = var6 / 2 - 91;
        var15 = var6 / 2 + 91;
        this.mc.mcProfiler.startSection("expBar");
        var16 = this.mc.thePlayer.xpBarCap();

        if (var16 > 0) {
          short var24 = 182;
          var18 = (int) (this.mc.thePlayer.experience * (float) (var24 + 1));
          var17 = var7 - 32 + 3;
          this.drawTexturedModalRect(var23, var17, 0, 64, var24, 5);

          if (var18 > 0) {
            this.drawTexturedModalRect(var23, var17, 0, 69, var18, 5);
          }
        }

        var19 = var7 - 39;
        var18 = var19 - 10;
        var17 = this.mc.thePlayer.getTotalArmorValue();
        int var41 = -1;

        if (this.mc.thePlayer.isPotionActive(Potion.regeneration)) {
          var41 = this.updateCounter % 25;
        }

        this.mc.mcProfiler.endStartSection("healthArmor");
        int var25;
        int var27;
        int var26;
        int var28;

        for (var25 = 0; var25 < 10; ++var25) {
          if (var17 > 0) {
            var26 = var23 + var25 * 8;

            if (var25 * 2 + 1 < var17) {
              this.drawTexturedModalRect(var26, var18, 34, 9, 9, 9);
            }

            if (var25 * 2 + 1 == var17) {
              this.drawTexturedModalRect(var26, var18, 25, 9, 9, 9);
            }

            if (var25 * 2 + 1 > var17) {
              this.drawTexturedModalRect(var26, var18, 16, 9, 9, 9);
            }
          }

          var26 = 16;

          if (this.mc.thePlayer.isPotionActive(Potion.poison)) {
            var26 += 36;
          }

          byte var29 = 0;

          if (var33) {
            var29 = 1;
          }

          var28 = var23 + var25 * 8;
          var27 = var19;

          if (var11 <= 4) {
            var27 = var19 + this.rand.nextInt(2);
          }

          if (var25 == var41) {
            var27 -= 2;
          }

          var30 = 0;

          if (this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled()) {
            var30 = 5;
          }

          this.drawTexturedModalRect(var28, var27, 16 + var29 * 9, 9 * var30, 9, 9);

          if (var33) {
            if (var25 * 2 + 1 < var12) {
              this.drawTexturedModalRect(var28, var27, var26 + 54, 9 * var30, 9, 9);
            }

            if (var25 * 2 + 1 == var12) {
              this.drawTexturedModalRect(var28, var27, var26 + 63, 9 * var30, 9, 9);
            }
          }

          if (var25 * 2 + 1 < var11) {
            this.drawTexturedModalRect(var28, var27, var26 + 36, 9 * var30, 9, 9);
          }

          if (var25 * 2 + 1 == var11) {
            this.drawTexturedModalRect(var28, var27, var26 + 45, 9 * var30, 9, 9);
          }
        }

        this.mc.mcProfiler.endStartSection("food");
        int var47;

        for (var25 = 0; var25 < 10; ++var25) {
          var26 = var19;
          var47 = 16;
          var30 = 0;

          if (this.mc.thePlayer.isPotionActive(Potion.hunger)) {
            var47 += 36;
            var30 = 13;
          }

          if (this.mc.thePlayer.getFoodStats().getSaturationLevel() <= 0.0F
              && this.updateCounter % (var14 * 3 + 1) == 0) {
            var26 = var19 + (this.rand.nextInt(3) - 1);
          }

          if (var21) {
            var30 = 1;
          }

          var27 = var15 - var25 * 8 - 9;
          this.drawTexturedModalRect(var27, var26, 16 + var30 * 9, 27, 9, 9);

          if (var21) {
            if (var25 * 2 + 1 < var13) {
              this.drawTexturedModalRect(var27, var26, var47 + 54, 27, 9, 9);
            }

            if (var25 * 2 + 1 == var13) {
              this.drawTexturedModalRect(var27, var26, var47 + 63, 27, 9, 9);
            }
          }

          if (var25 * 2 + 1 < var14) {
            this.drawTexturedModalRect(var27, var26, var47 + 36, 27, 9, 9);
          }

          if (var25 * 2 + 1 == var14) {
            this.drawTexturedModalRect(var27, var26, var47 + 45, 27, 9, 9);
          }
        }

        this.mc.mcProfiler.endStartSection("air");

        if (this.mc.thePlayer.isInsideOfMaterial(Material.water)) {
          var25 = this.mc.thePlayer.getAir();
          var26 = MathHelper.ceiling_double_int((double) (var25 - 2) * 10.0D / 300.0D);
          var47 = MathHelper.ceiling_double_int((double) var25 * 10.0D / 300.0D) - var26;

          for (var28 = 0; var28 < var26 + var47; ++var28) {
            if (var28 < var26) {
              this.drawTexturedModalRect(var15 - var28 * 8 - 9, var18, 16, 18, 9, 9);
            } else {
              this.drawTexturedModalRect(var15 - var28 * 8 - 9, var18, 25, 18, 9, 9);
            }
          }
        }

        this.mc.mcProfiler.endSection();
      }

      GL11.glDisable(GL11.GL_BLEND);
      this.mc.mcProfiler.startSection("actionBar");
      GL11.glEnable(GL12.GL_RESCALE_NORMAL);
      RenderHelper.enableGUIStandardItemLighting();

      for (var23 = 0; var23 < 9; ++var23) {
        var15 = var6 / 2 - 90 + var23 * 20 + 2;
        var16 = var7 - 16 - 3;
        this.renderInventorySlot(var23, var15, var16, par1);
      }

      RenderHelper.disableStandardItemLighting();
      GL11.glDisable(GL12.GL_RESCALE_NORMAL);
      this.mc.mcProfiler.endSection();
    }

    float var34;
    int var36;

    if (this.mc.thePlayer.getSleepTimer() > 0) {
      this.mc.mcProfiler.startSection("sleep");
      GL11.glDisable(GL11.GL_DEPTH_TEST);
      GL11.glDisable(GL11.GL_ALPHA_TEST);
      var36 = this.mc.thePlayer.getSleepTimer();
      var34 = (float) var36 / 100.0F;

      if (var34 > 1.0F) {
        var34 = 1.0F - (float) (var36 - 100) / 10.0F;
      }

      var11 = (int) (220.0F * var34) << 24 | 1052704;
      drawRect(0, 0, var6, var7, var11);
      GL11.glEnable(GL11.GL_ALPHA_TEST);
      GL11.glEnable(GL11.GL_DEPTH_TEST);
      this.mc.mcProfiler.endSection();
    }

    int var35;
    String var40;

    if (this.mc.playerController.func_78763_f() && this.mc.thePlayer.experienceLevel > 0) {
      this.mc.mcProfiler.startSection("expLevel");
      var33 = false;
      var11 = var33 ? 16777215 : 8453920;
      var40 = "" + this.mc.thePlayer.experienceLevel;
      var35 = (var6 - var8.getStringWidth(var40)) / 2;
      var36 = var7 - 31 - 4;
      var8.drawString(var40, var35 + 1, var36, 0);
      var8.drawString(var40, var35 - 1, var36, 0);
      var8.drawString(var40, var35, var36 + 1, 0);
      var8.drawString(var40, var35, var36 - 1, 0);
      var8.drawString(var40, var35, var36, var11);
      this.mc.mcProfiler.endSection();
    }

    if (this.mc.isDemo()) {
      this.mc.mcProfiler.startSection("demo");
      var40 = "";

      if (this.mc.theWorld.getWorldTime() >= 120500L) {
        var40 = StatCollector.translateToLocal("demo.demoExpired");
      } else {
        var40 =
            String.format(
                StatCollector.translateToLocal("demo.remainingTime"),
                new Object[] {
                  StringUtils.ticksToElapsedTime((int) (120500L - this.mc.theWorld.getWorldTime()))
                });
      }

      var11 = var8.getStringWidth(var40);
      var8.drawStringWithShadow(var40, var6 - var11 - 10, 5, 16777215);
      this.mc.mcProfiler.endSection();
    }

    if (this.mc.gameSettings.showDebugInfo) {
      this.mc.mcProfiler.startSection("debug");
      GL11.glPushMatrix();
      var8.drawStringWithShadow("Minecraft 1.3.2 (" + this.mc.debug + ")", 2, 2, 16777215);
      var8.drawStringWithShadow(this.mc.debugInfoRenders(), 2, 12, 16777215);
      var8.drawStringWithShadow(this.mc.getEntityDebug(), 2, 22, 16777215);
      var8.drawStringWithShadow(this.mc.debugInfoEntities(), 2, 32, 16777215);
      var8.drawStringWithShadow(this.mc.getWorldProviderName(), 2, 42, 16777215);
      long var38 = Runtime.getRuntime().maxMemory();
      long var42 = Runtime.getRuntime().totalMemory();
      long var45 = Runtime.getRuntime().freeMemory();
      long var49 = var42 - var45;
      String var31 =
          "Used memory: "
              + var49 * 100L / var38
              + "% ("
              + var49 / 1024L / 1024L
              + "MB) of "
              + var38 / 1024L / 1024L
              + "MB";
      this.drawString(var8, var31, var6 - var8.getStringWidth(var31) - 2, 2, 14737632);
      var31 = "Allocated memory: " + var42 * 100L / var38 + "% (" + var42 / 1024L / 1024L + "MB)";
      this.drawString(var8, var31, var6 - var8.getStringWidth(var31) - 2, 12, 14737632);
      this.drawString(
          var8,
          String.format("x: %.5f", new Object[] {Double.valueOf(this.mc.thePlayer.posX)}),
          2,
          64,
          14737632);
      this.drawString(
          var8,
          String.format(
              "y: %.3f (feet pos, %.3f eyes pos)",
              new Object[] {
                Double.valueOf(this.mc.thePlayer.boundingBox.minY),
                Double.valueOf(this.mc.thePlayer.posY)
              }),
          2,
          72,
          14737632);
      this.drawString(
          var8,
          String.format("z: %.5f", new Object[] {Double.valueOf(this.mc.thePlayer.posZ)}),
          2,
          80,
          14737632);
      this.drawString(
          var8,
          "f: "
              + (MathHelper.floor_double(
                      (double) (this.mc.thePlayer.rotationYaw * 4.0F / 360.0F) + 0.5D)
                  & 3),
          2,
          88,
          14737632);
      var19 = MathHelper.floor_double(this.mc.thePlayer.posX);
      var18 = MathHelper.floor_double(this.mc.thePlayer.posY);
      var17 = MathHelper.floor_double(this.mc.thePlayer.posZ);

      if (this.mc.theWorld != null && this.mc.theWorld.blockExists(var19, var18, var17)) {
        Chunk var32 = this.mc.theWorld.getChunkFromBlockCoords(var19, var17);
        this.drawString(
            var8,
            "lc: "
                + (var32.getTopFilledSegment() + 15)
                + " b: "
                + var32.getBiomeGenForWorldCoords(
                        var19 & 15, var17 & 15, this.mc.theWorld.getWorldChunkManager())
                    .biomeName
                + " bl: "
                + var32.getSavedLightValue(EnumSkyBlock.Block, var19 & 15, var18, var17 & 15)
                + " sl: "
                + var32.getSavedLightValue(EnumSkyBlock.Sky, var19 & 15, var18, var17 & 15)
                + " rl: "
                + var32.getBlockLightValue(var19 & 15, var18, var17 & 15, 0),
            2,
            96,
            14737632);
      }

      this.drawString(
          var8,
          String.format(
              "ws: %.3f, fs: %.3f, g: %b",
              new Object[] {
                Float.valueOf(this.mc.thePlayer.capabilities.getWalkSpeed()),
                Float.valueOf(this.mc.thePlayer.capabilities.getFlySpeed()),
                Boolean.valueOf(this.mc.thePlayer.onGround)
              }),
          2,
          104,
          14737632);
      GL11.glPopMatrix();
      this.mc.mcProfiler.endSection();
    } else {
      AxiomSetup.renderIGGUI();
    }

    if (this.recordPlayingUpFor > 0) {
      this.mc.mcProfiler.startSection("overlayMessage");
      var34 = (float) this.recordPlayingUpFor - par1;
      var11 = (int) (var34 * 256.0F / 20.0F);

      if (var11 > 255) {
        var11 = 255;
      }

      if (var11 > 0) {
        GL11.glPushMatrix();
        GL11.glTranslatef((float) (var6 / 2), (float) (var7 - 48), 0.0F);
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        var12 = 16777215;

        if (this.recordIsPlaying) {
          var12 = Color.HSBtoRGB(var34 / 50.0F, 0.7F, 0.6F) & 16777215;
        }

        var8.drawString(
            this.recordPlaying,
            -var8.getStringWidth(this.recordPlaying) / 2,
            -4,
            var12 + (var11 << 24));
        GL11.glDisable(GL11.GL_BLEND);
        GL11.glPopMatrix();
      }

      this.mc.mcProfiler.endSection();
    }

    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glDisable(GL11.GL_ALPHA_TEST);
    GL11.glPushMatrix();
    GL11.glTranslatef(0.0F, (float) (var7 - 48), 0.0F);
    this.mc.mcProfiler.startSection("chat");
    this.persistantChatGUI.func_73762_a(this.updateCounter);
    this.mc.mcProfiler.endSection();
    GL11.glPopMatrix();

    if (this.mc.gameSettings.keyBindPlayerList.pressed
        && (!this.mc.isIntegratedServerRunning()
            || this.mc.thePlayer.sendQueue.playerInfoList.size() > 1)) {
      this.mc.mcProfiler.startSection("playerList");
      NetClientHandler var39 = this.mc.thePlayer.sendQueue;
      List var37 = var39.playerInfoList;
      var12 = var39.currentServerMaxPlayers;
      var35 = var12;

      for (var36 = 1; var35 > 20; var35 = (var12 + var36 - 1) / var36) {
        ++var36;
      }

      var14 = 300 / var36;

      if (var14 > 150) {
        var14 = 150;
      }

      var13 = (var6 - var36 * var14) / 2;
      byte var43 = 10;
      drawRect(var13 - 1, var43 - 1, var13 + var14 * var36, var43 + 9 * var35, Integer.MIN_VALUE);

      for (var15 = 0; var15 < var12; ++var15) {
        var16 = var13 + var15 % var36 * var14;
        var19 = var43 + var15 / var36 * 9;
        drawRect(var16, var19, var16 + var14 - 1, var19 + 8, 553648127);
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        GL11.glEnable(GL11.GL_ALPHA_TEST);

        if (var15 < var37.size()) {
          GuiPlayerInfo var48 = (GuiPlayerInfo) var37.get(var15);
          String var44 = AxiomHook.tabListNameSetHook(var48.name);
          var8.drawStringWithShadow(var44, var16, var19, 16777215);
          this.mc.renderEngine.bindTexture(this.mc.renderEngine.getTexture("/gui/icons.png"));
          byte var46 = 0;
          boolean var50 = false;

          if (var48.responseTime < 0) {
            var30 = 5;
          } else if (var48.responseTime < 150) {
            var30 = 0;
          } else if (var48.responseTime < 300) {
            var30 = 1;
          } else if (var48.responseTime < 600) {
            var30 = 2;
          } else if (var48.responseTime < 1000) {
            var30 = 3;
          } else {
            var30 = 4;
          }

          this.zLevel += 100.0F;
          this.drawTexturedModalRect(
              var16 + var14 - 12, var19, 0 + var46 * 10, 176 + var30 * 8, 10, 8);
          this.zLevel -= 100.0F;
        }
      }
    }

    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glEnable(GL11.GL_ALPHA_TEST);
  }
コード例 #18
0
ファイル: Gui.java プロジェクト: MacTheZazou/CartasianeWork
 /** Renders the specified text to the screen. */
 public void drawString(
     FontRenderer par1FontRenderer, String par2Str, int par3, int par4, int par5) {
   par1FontRenderer.drawStringWithShadow(par2Str, par3, par4, par5);
 }
コード例 #19
0
ファイル: Gui.java プロジェクト: MacTheZazou/CartasianeWork
 /** Renders the specified text to the screen, center-aligned. */
 public void drawCenteredString(
     FontRenderer par1FontRenderer, String par2Str, int par3, int par4, int par5) {
   par1FontRenderer.drawStringWithShadow(
       par2Str, par3 - par1FontRenderer.getStringWidth(par2Str) / 2, par4, par5);
 }