diff --git a/services/modpack-version-checker/blueprint-extension/README.md b/services/modpack-version-checker/blueprint-extension/README.md index 72adc39..bfa1664 100644 --- a/services/modpack-version-checker/blueprint-extension/README.md +++ b/services/modpack-version-checker/blueprint-extension/README.md @@ -48,9 +48,9 @@ A Pterodactyl Panel extension that checks modpack versions across CurseForge, Mo | CurseForge | Numeric project ID | ✅ Yes | ✅ Working | | Modrinth | Project ID or slug | ❌ No | ✅ Working | | FTB | Numeric modpack ID | ❌ No | ✅ Working | -| Technic | URL slug | ⚠️ Unknown | ❌ 401 Auth Error | +| Technic | URL slug | ❌ No | ✅ Working | -> **Note (April 2026):** Technic Platform API now returns 401 Unauthorized. They may have changed their authentication requirements. Investigation ongoing. +> **Note:** Technic requires a dynamic build number parameter. The extension automatically fetches the current launcher build from Technic's API to avoid 401 errors. --- diff --git a/services/modpack-version-checker/blueprint-extension/app/Http/Controllers/ModpackAPIController.php b/services/modpack-version-checker/blueprint-extension/app/Http/Controllers/ModpackAPIController.php index 77a1ddf..ae855b5 100644 --- a/services/modpack-version-checker/blueprint-extension/app/Http/Controllers/ModpackAPIController.php +++ b/services/modpack-version-checker/blueprint-extension/app/Http/Controllers/ModpackAPIController.php @@ -434,9 +434,22 @@ class ModpackAPIController extends Controller */ private function checkTechnic(string $slug): array { + // TECHNIC API FIX (Gemini consultation, April 2026): + // Technic blocks requests with old/invalid build numbers. + // We dynamically fetch the current stable launcher build to avoid 401s. + // This "RV-Ready" approach requires zero maintenance as builds update. + + // Step 1: Get current stable launcher build number + $versionResponse = Http::get('https://api.technicpack.net/launcher/version/stable4'); + $latestBuild = $versionResponse->successful() + ? ($versionResponse->json('build') ?? 999) + : 999; // Fallback to high number if version check fails + + // Step 2: Fetch modpack data with valid build number $response = Http::withHeaders([ + 'User-Agent' => 'FirefrostGaming/ModpackChecker/1.0', 'Accept' => 'application/json', - ])->get("https://api.technicpack.net/modpack/{$slug}?build=1"); + ])->get("https://api.technicpack.net/modpack/{$slug}?build={$latestBuild}"); if (!$response->successful()) { throw new \Exception('Technic API request failed: ' . $response->status());