Ejemplo n.º 1
0
 public static String getDurationString(PotionEffect p_76389_0_) {
   if (p_76389_0_.getIsPotionDurationMax()) {
     return "**:**";
   } else {
     int var1 = p_76389_0_.getDuration();
     return StringUtils.ticksToElapsedTime(var1);
   }
 }
Ejemplo n.º 2
0
  protected void renderHUDText(int width, int height) {
    mc.mcProfiler.startSection("forgeHudText");
    OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
    ArrayList<String> listL = new ArrayList<String>();
    ArrayList<String> listR = new ArrayList<String>();

    if (mc.isDemo()) {
      long time = mc.theWorld.getTotalWorldTime();
      if (time >= 120500L) {
        listR.add(I18n.format("demo.demoExpired"));
      } else {
        listR.add(
            I18n.format(
                "demo.remainingTime", StringUtils.ticksToElapsedTime((int) (120500L - time))));
      }
    }

    if (this.mc.gameSettings.showDebugInfo && !pre(DEBUG)) {
      listL.addAll(debugOverlay.getLeft());
      listR.addAll(debugOverlay.getRight());
      post(DEBUG);
    }

    RenderGameOverlayEvent.Text event = new RenderGameOverlayEvent.Text(eventParent, listL, listR);
    if (!MinecraftForge.EVENT_BUS.post(event)) {
      int top = 2;
      for (String msg : listL) {
        if (msg == null) continue;
        drawRect(
            1,
            top - 1,
            2 + fontrenderer.getStringWidth(msg) + 1,
            top + fontrenderer.FONT_HEIGHT - 1,
            -1873784752);
        fontrenderer.drawString(msg, 2, top, 14737632);
        top += fontrenderer.FONT_HEIGHT;
      }

      top = 2;
      for (String msg : listR) {
        if (msg == null) continue;
        int w = fontrenderer.getStringWidth(msg);
        int left = width - 2 - w;
        drawRect(left - 1, top - 1, left + w + 1, top + fontrenderer.FONT_HEIGHT - 1, -1873784752);
        fontrenderer.drawString(msg, left, top, 14737632);
        top += fontrenderer.FONT_HEIGHT;
      }
    }

    mc.mcProfiler.endSection();
    post(TEXT);
  }
Ejemplo n.º 3
0
  public void func_175185_b(ScaledResolution p_175185_1_) {
    this.mc.mcProfiler.startSection("demo");
    String var2 = "";

    if (this.mc.theWorld.getTotalWorldTime() >= 120500L) {
      var2 = I18n.format("demo.demoExpired", new Object[0]);
    } else {
      var2 =
          I18n.format(
              "demo.remainingTime",
              new Object[] {
                StringUtils.ticksToElapsedTime(
                    (int) (120500L - this.mc.theWorld.getTotalWorldTime()))
              });
    }

    int var3 = this.func_175179_f().getStringWidth(var2);
    this.func_175179_f()
        .func_175063_a(var2, (float) (p_175185_1_.getScaledWidth() - var3 - 10), 5.0F, 16777215);
    this.mc.mcProfiler.endSection();
  }