flathub / com.mojang.Minecraft

https://flathub.org/apps/details/com.mojang.Minecraft
33 stars 13 forks source link

"Downloading update files..." repeated immediately when restarting launcher after disabling hw acceleration #150

Open ell1e opened 1 month ago

ell1e commented 1 month ago

I just tried the launcher after waiting for a while for "Downloading update files..." to finish. Then I logged in and disabled hw acceleration so it won't interfere with games as much and immediately restarted it, mere seconds after launching. But when I had restarted the launcher, I got the "Download update files..." popup again starting over from 0%. Since that just completed a few minutes ago, I'm assuming this is likely to be a bug of some sort.

Problem seen with launcher version: 1.0.1221 from flathub

Problem seen with linux system: postmarketOS Edge x64 based on Alpine 3.21.0_alpha20240923

Arcitec commented 3 weeks ago

Hello @ell1e.

The reason this is happening is because this Flatpak is completely incorrectly created. @AsciiWolf may want to know what's wrong, so it can be fixed, though:

You can even see how old that version is if you check the URL. That launcher is from 2022, whereas the newest launcher file I linked to below is from October 2024.

Relevant part:

        "name": "1.0.1221",
        "released": "2022-03-23T23:03:04+00:00"

Full response:

{
  "jre-x64": [],
  "jre-x86": [],
  "launcher-bootstrap": [
    {
      "availability": {
        "group": 2631,
        "progress": 100
      },
      "manifest": {
        "sha1": "d72c08ef9605e645fd81f705d66b8ebd9620d7a1",
        "size": 466,
        "url": "https://piston-meta.mojang.com/v1/packages/d72c08ef9605e645fd81f705d66b8ebd9620d7a1/manifest.json"
      },
      "version": {
        "name": "1.0.1221",
        "released": "2022-03-23T23:03:04+00:00"
      }
    }
  ],
  "launcher-bootstrap-ado": [
    {
      "availability": {
        "group": 5478,
        "progress": 100
      },
      "manifest": {
        "sha1": "70d6d24a24406dbeb80cda53ac70be6944e2e279",
        "size": 466,
        "url": "https://piston-meta.mojang.com/v1/packages/70d6d24a24406dbeb80cda53ac70be6944e2e279/manifest.json"
      },
      "version": {
        "name": "1.2.30",
        "released": "2023-06-23T15:56:44+00:00"
      }
    }
  ],
  "launcher-core": [
    {
      "availability": {
        "group": 1729,
        "progress": 100
      },
      "manifest": {
        "sha1": "ea71747a98dd806fb3b77cdc50fa69ea9092855d",
        "size": 28504,
        "url": "https://piston-meta.mojang.com/v1/packages/ea71747a98dd806fb3b77cdc50fa69ea9092855d/manifest.json"
      },
      "version": {
        "name": "2.2.2141",
        "released": "2021-03-01T12:01:53+00:00"
      }
    }
  ],
  "launcher-core-ado": [
    {
      "availability": {
        "group": 4117,
        "progress": 100
      },
      "manifest": {
        "sha1": "0f5faa36de53cc2883b501a7a18e402966930f2b",
        "size": 34647,
        "url": "https://piston-meta.mojang.com/v1/packages/0f5faa36de53cc2883b501a7a18e402966930f2b/manifest.json"
      },
      "version": {
        "name": "2.4.104",
        "released": "2023-06-02T22:28:50+00:00"
      }
    }
  ],
  "launcher-core-v2": [
    {
      "availability": {
        "group": 4022,
        "progress": 100
      },
      "manifest": {
        "sha1": "f274468b435cbe5369c9787d31cba7fe16102c69",
        "size": 29504,
        "url": "https://piston-meta.mojang.com/v1/packages/f274468b435cbe5369c9787d31cba7fe16102c69/manifest.json"
      },
      "version": {
        "name": "2.2.12148",
        "released": "2022-03-24T03:13:44+00:00"
      }
    }
  ],
  "launcher-java": [
    {
      "availability": {
        "group": 261,
        "progress": 100
      },
      "manifest": {
        "sha1": "f1bd83c4f1ec402992649a994596ffe64c4630d6",
        "size": 295,
        "url": "https://piston-meta.mojang.com/v1/packages/f1bd83c4f1ec402992649a994596ffe64c4630d6/manifest.json"
      },
      "version": {
        "name": "1.6.93",
        "released": "2019-09-12T09:06:53+00:00"
      }
    }
  ],
  "launcher-msi-patch": []
}

The actual up-to-date Minecraft Launcher is at https://www.minecraft.net/en-us/download/alternative and the correct download URL is https://launcher.mojang.com/download/Minecraft.tar.gz

The entire Flatpak manifest needs a rewrite to do this. And to use a different Flatpak Manifest auto-update check method. There may be a x-checker-data method that looks at the server's "last-modified" headers, since they never change the launcher download's filename anymore.

Edit: It may need a new x-checker-data feature: https://github.com/flathub-infra/flatpak-external-data-checker/issues/442


As for Ellie, you should really consider using ATLauncher instead:

https://flathub.org/apps/com.atlauncher.ATLauncher

Here's a video about it: https://www.youtube.com/watch?v=P21LUffrL1w

It auto-manages Mojang Java for you, supports installing modpacks with one click (from CurseForge, Modrinth, FTB and Technic, and others), lets you create multiple Minecraft versions ("instances") with different modpacks to try them out, and it works a lot more reliably than the official launcher.

More technical users can use Prism Launcher. It's very powerful but fiddly (one of the weirdest things is that you must manually go to "Edit" after creating an instance and then "Versions: Download All" to download the necessary files for an instance). And I am not sure if the prebuilt Flatpak version supports auto-managing Mojang Java yet (but the latest development code does, which is what I use). I can recommend it for technical users though, since it gives a great overview of everything that goes on, and supports modding from all sources (CurseForge, Modrinth, FTB, Technic, ATLauncher and others).

Actually, Prism can be used by anyone who is willing to take a few minutes to watch a video about how to use it. It's a great launcher. Just a bit clunky to learn its UI the first time you use it.

https://flathub.org/apps/org.prismlauncher.PrismLauncher

Hope this helps! :)

AsciiWolf commented 3 weeks ago

Thanks for your comment! I don't think that "the entire Flatpak manifest needs a rewrite", actually the new archive format seems to be the same (tarball with just one minecraft-launcher binary). Although directly linking Minecraft.tar.gz without any version suffix is far from being ideal since it will break when a new archive (with different checksum gets released). Sadly, I don't have enough time to be able to work on this (especially on the x-data-checker part). But if you can, please, consider sending a Pull request.

By the way, AT Launcher and Prism Launcher are not intended for regular users and even though they are both great launchers, they are not a direct replacement for this Flatpak.