Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-273464

Incorrect partial tick during screen render

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 24w33a
    • 1.21
    • None
    • Community Consensus
    • UI
    • Normal
    • Platform

      Screens relying on partial ticks for interpolation are using the wrong value in 1.21, causing animations to be played in extremely low FPS.  As an example, a video clip of the Enchanting Table's book (which relies on partial ticks) is attached. The first clip shows 1.20.1, and the latter shows 1.21.  The FPS difference is extremely noticeable.

      The source of the problem lies in using the wrong method when calling render for both the overlay and the current screen. Both uses of getRealtimeDeltaTicks in the following code block (from GameRenderer) should be replaced with getGameTimeDeltaPartialTick(false)

      Snippet from GameRenderer#render:

      if (this.minecraft.getOverlay() != null) {
      try {
      this.minecraft.getOverlay().render(guigraphics, i, j, p_348648_.getRealtimeDeltaTicks());
      } catch (Throwable throwable2) {
      CrashReport crashreport = CrashReport.forThrowable(throwable2, "Rendering overlay");
      CrashReportCategory crashreportcategory = crashreport.addCategory("Overlay render details");
      crashreportcategory.setDetail("Overlay name", () -> this.minecraft.getOverlay().getClass().getCanonicalName());
      throw new ReportedException(crashreport);
      }
      } else if (flag && this.minecraft.screen != null) {
      try {
      this.minecraft.screen.renderWithTooltip(guigraphics, i, j, p_348648_.getRealtimeDeltaTicks());
      

            TommyWallberg [Mojang] TommyWallberg
            Shadows_of_Fire Shadows_of_Fire
            Votes:
            6 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: