diff --git a/README.md b/README.md index 04bc58c..3055edc 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ Both launchers are essentially the same program with one key difference: This hybrid approach ensures reliable automated installation while providing the optimal splitscreen gaming experience. ## What gets installed -- [PollyMC](https://github.com/fn2006/PollyMC) AppImage (primary launcher) +- [PollyMC](https://github.com/SharathGames1/PollyMC) AppImage (primary launcher) - **Minecraft version:** User-selectable (defaults to latest stable release, with 4 separate instances for splitscreen) - **Fabric Loader:** Complete dependency chain including LWJGL 3, Minecraft, Intermediary Mappings, and Fabric Loader - **Mods included (automatically installed):** @@ -192,7 +192,7 @@ To update your Minecraft version or mod configuration: ## Credits - Inspired by [ArnoldSmith86/minecraft-splitscreen](https://github.com/ArnoldSmith86/minecraft-splitscreen) (original concept/script, but this project is mostly a full rewrite). - Additional contributions by [FlyingEwok](https://github.com/FlyingEwok) and others. -- Uses [PollyMC](https://github.com/fn2006/PollyMC) for gameplay and [PrismLauncher](https://github.com/PrismLauncher/PrismLauncher) for instance creation. +- Uses [PollyMC](https://github.com/SharathGames1/PollyMC) for gameplay and [PrismLauncher](https://github.com/PrismLauncher/PrismLauncher) for instance creation. - Steam Deck Java installation script by [FlyingEwok](https://github.com/FlyingEwok/install-jdk-on-steam-deck) - provides seamless Java installation for Steam Deck's read-only filesystem with automatic version detection. - Steam Deck controller auto-disable tool by [scawp](https://github.com/scawp/Steam-Deck.Auto-Disable-Steam-Controller) - automatically disables built-in Steam Deck controller when external controllers are connected, essential for proper splitscreen controller counting. diff --git a/modules/pollymc_setup.sh b/modules/pollymc_setup.sh index 9d498f4..8c3054a 100644 --- a/modules/pollymc_setup.sh +++ b/modules/pollymc_setup.sh @@ -53,9 +53,30 @@ setup_pollymc() { # Download PollyMC AppImage from official GitHub releases # AppImage format provides universal Linux compatibility without dependencies - # PollyMC GitHub releases API endpoint for latest version - # We download the x86_64 Linux AppImage which works on most modern Linux systems - local pollymc_url="https://github.com/fn2006/PollyMC/releases/latest/download/PollyMC-Linux-x86_64.AppImage" + # Resolve the latest x86_64 AppImage dynamically from release metadata because + # asset names can change between releases. + local pollymc_url="" + local pollymc_release_json="" + local pollymc_repo="SharathGames1/PollyMC" + pollymc_release_json="$(wget -qO- "https://api.github.com/repos/${pollymc_repo}/releases/latest" 2>/dev/null || true)" + + if [[ -n "$pollymc_release_json" ]]; then + pollymc_url="$(jq -r '.assets[]? | select((.name | test("AppImage$")) and (.name | test("x86_64|amd64"; "i"))) | .browser_download_url' \ + <<< "$pollymc_release_json" 2>/dev/null | head -n1 || true)" + fi + + # Fallback: choose any AppImage if architecture-specific asset not detected. + if [[ -z "$pollymc_url" || "$pollymc_url" == "null" ]]; then + pollymc_url="$(jq -r '.assets[]? | select(.name | test("AppImage$")) | .browser_download_url' \ + <<< "$pollymc_release_json" 2>/dev/null | head -n1 || true)" + fi + + # Last-resort fallback to legacy static URL for environments where API access is blocked. + if [[ -z "$pollymc_url" || "$pollymc_url" == "null" ]]; then + pollymc_url="https://github.com/${pollymc_repo}/releases/latest/download/PollyMC-Linux-x86_64.AppImage" + print_warning "Could not resolve PollyMC asset via GitHub API, using legacy static URL fallback" + fi + print_progress "Fetching PollyMC from GitHub releases: $(basename "$pollymc_url")..." # DOWNLOAD WITH FALLBACK HANDLING