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

Refresh button in the multiplayer menu resets the position of the slider

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Works As Intended
    • None
    • Snapshot 13w11a, Minecraft 1.5.1, Minecraft 1.5.2, Snapshot 13w18c, Snapshot 13w19a, Minecraft 1.6.2, Minecraft 1.6.4, Minecraft 13w39b, Minecraft 1.7.4, Minecraft 14w05b, Minecraft 14w06b, Minecraft 14w07a, Minecraft 14w08a, Minecraft 1.7.5, Minecraft 14w10b, Minecraft 14w10c, Minecraft 14w11b, Minecraft 14w17a, Minecraft 14w18a, Minecraft 1.8, Minecraft 1.8.1-pre3, Minecraft 1.8.8, Minecraft 15w39c, Minecraft 1.11, Minecraft 1.12.1, Minecraft 1.12.2, Minecraft 17w43a, Minecraft 17w43b, Minecraft 18w02a, Minecraft 1.13, Minecraft 18w30b, Minecraft 18w31a, Minecraft 18w32a, Minecraft 18w33a, Minecraft 1.13.1, Minecraft 1.13.2-pre1, Minecraft 1.13.2-pre2, Minecraft 1.13.2, Minecraft 18w48a, Minecraft 18w48b, Minecraft 18w49a, Minecraft 19w12b, Minecraft 19w13b, Minecraft 19w14a, Minecraft 19w14b, Minecraft 1.14 Pre-Release 2, 1.15.2, 1.16 Pre-release 2, 1.16 Pre-release 5, 1.16 Pre-release 6, 1.16 Release Candidate 1, 1.16, 1.16.1, 20w29a, 1.16.2, 1.16.4, 20w48a, 20w51a, 1.17
    • None
    • Confirmed
    • UI

      The bug

      The refresh button in the multiplayer server menu always takes you up top of the menu.

      How to reproduce

      1. Open your server list and scroll down.
      2. Press the Refresh button.
        It opens a new multiplayer menu and therefore the slider position resets

      Code analysis

      The following is based on yarn 1.15.2 names.

      The reason for this issue is quite simple, as the server list refresh button opens a new multiplayer screen and that causes the servers to refresh. A fix for this issue would be to track the position of the bar and set the bar to that when refreshing. Very basic example:

        private void refresh() {
              this.minecraft.openScreen(new MultiplayerScreen(this.parent));
              //sets slider position
              this.setSlider(previousSliderZ);
              //resets it to 0 after being set with the now old value
              this.previousSliderZ = 0;
          }
      

      Where the setSlider instance, sets the slider to the given z (vertical) and the int (or double) previousSliderZ would be the previous z position of the slider. In theory, should work.

        1. 1.png
          1.png
          67 kB
        2. 2.png
          2.png
          67 kB
        3. 3.png
          3.png
          73 kB
        4. 4.png
          4.png
          87 kB
        5. Minecraft_ 1.16.1 2020-07-17 16-31-08.mp4
          4.00 MB

            Unassigned Unassigned
            Oval Oval
            Votes:
            9 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: