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

Demo Mode: The "Purchase Now!" link does not use the confirmation screen

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 22w18a, 22w19a, 1.19 Pre-release 2, 1.19.2, 22w42a, 22w43a, 22w45a, 22w46a, 1.20.1, 23w33a, 23w35a, 1.20.4, 24w10a, 24w13a, 24w14a, 1.20.5 Pre-Release 1, 1.20.5 Pre-Release 4, 1.21
    • None
    • Confirmed
    • UI
    • Low
    • Platform

      The bug

      When clicking on the "Purchase Now!" CTA in the Demo Mode introduction popup, the Minecraft Store link is immediately opened, without showing the link confirmation ("Do you want to open this link...?") screen.

      This is inconsistent with other buttons in the game's UI that open a web link.

      To reproduce

      1. Run the game in Demo mode. (You can do this manually by specifying the correct arguments to the client.jar or you can select a Mojang account that has not brought the game in the Launcher.)
      2. Click "Play Demo World" to generate/enter the demo world.
      3. When the Demo Mode introduction popup appears, click the "Purchase Now" button on the left.

      Code analysis (Official Mappings)

      Other buttons

      When any other button that opens a link is clicked, the callback function looks something like this:

      this.minecraft.setScreen(new ConfirmLinkScreen($$0 -> {
          if ($$0) {
              Util.getPlatform().openUri(GUIDE_LINK);
          }
          this.minecraft.setScreen(this);
      }, GUIDE_LINK, true));
      

      As you can see, the whole thing is wrapped in a ConfirmLinkScreen that will only open the link if the "Yes" button is clicked.

      Purchase Now! button

      However, when the "Purchase Now!" button is clicked, this callback is executed:

      $$0.active = false;
      Util.getPlatform().openUri("http://www.minecraft.net/store?source=demo");
      

      This simply disables the button and then directly opens the URL, without opening a ConfirmLinkScreen. It should probably look similar to the first example.

      Screenshots

      The Demo Mode introduction popup:

            Unassigned Unassigned
            MishMoshKeel21 MMK21
            Votes:
            6 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              CHK: