# Gooverton Modded - OptiFine 1.12.2 1-Click Installer [Console]::OutputEncoding = [System.Text.Encoding]::UTF8 $Host.UI.RawUI.WindowTitle = "OptiFine 1.12.2 HD U G5 Installer" $toolsDir = Split-Path -Parent $MyInvocation.MyCommand.Path $modsDir = Join-Path (Split-Path -Parent $toolsDir) "mods" $destFile = Join-Path $modsDir "OptiFine_1.12.2_HD_U_G5.jar" Write-Host "Папка установки модов: $modsDir" -ForegroundColor Cyan if (-not (Test-Path $modsDir)) { New-Item -ItemType Directory -Path $modsDir -Force | Out-Null } $adloadUrl = "https://optifine.net/adloadx?f=OptiFine_1.12.2_HD_U_G5.jar" Write-Host "Получение ссылки на загрузку с optifine.net..." -ForegroundColor Yellow $wc = New-Object System.Net.WebClient $wc.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64)") try { $html = $wc.DownloadString($adloadUrl) if ($html -match "href=['""](downloadx\?[^'""]+)['""]") { $relUrl = $matches[1] $downloadUrl = "https://optifine.net/$relUrl" Write-Host "Найдена прямая ссылка. Скачивание OptiFine 1.12.2..." -ForegroundColor Green $wc.Headers.Add("Referer", $adloadUrl) $wc.DownloadFile($downloadUrl, $destFile) # Verify file if ((Test-Path $destFile) -and ((Get-Item $destFile).Length -gt 1000000)) { Write-Host "`n[УСПЕХ] OptiFine_1.12.2_HD_U_G5.jar успешно загружен!" -ForegroundColor Green Write-Host "Файл сохранен в: $destFile" -ForegroundColor Green Write-Host "`nТеперь запустите игру через лаунчер." -ForegroundColor White Write-Host "В игре: Настройки -> Настройки графики -> Шейдеры -> выберите Complementary Reimagined." -ForegroundColor Cyan exit 0 } else { throw "Скачанный файл поврежден или имеет неверный размер." } } else { throw "Не удалось распарсить ссылку на зеркало загрузки OptiFine." } } catch { Write-Host "`n[ОШИБКА] $($_.Exception.Message)" -ForegroundColor Red Write-Host "Пожалуйста, скачайте OptiFine_1.12.2_HD_U_G5.jar вручную с: https://optifine.net/downloads" -ForegroundColor Yellow Write-Host "и скопируйте его в: $modsDir" -ForegroundColor Yellow exit 1 }