mojira.dev
MC-12289

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

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.

Attachments

Comments 29

Yeah this one's been around since multiplayer began, they really need to fix it.

Still a concern in 1.7.4/5 and 1.8

19 more comments

Confirmed in 1.16-pre8.

Confirmed in 1.16-rc1.

Can confirm for 1.16.1 and 20w29a

Can confirm in 20w51a.

Can confirm in 1.17.

Lazini

Oval

(Unassigned)

Confirmed

UI

Snapshot 13w11a, Minecraft 1.5.1, Minecraft 1.5.2, Snapshot 13w18c, Snapshot 13w19a, ..., 1.16.2, 1.16.4, 20w48a, 20w51a, 1.17

Retrieved