2026-09-08 19:44:45 +03:00
|
|
|
param([string]$MinecraftDirectory = "$env:APPDATA/.minecraft", [string]$ResourcePack)
|
2026-09-06 11:45:41 +03:00
|
|
|
$ErrorActionPreference = 'Stop'
|
|
|
|
|
$repo = Split-Path $PSScriptRoot -Parent
|
2026-09-08 19:44:45 +03:00
|
|
|
if (!$ResourcePack) {
|
|
|
|
|
$run = (Get-Content -LiteralPath "$repo/build/active-verification.txt" -Raw).Trim()
|
|
|
|
|
$ResourcePack = Join-Path $run 'astraplus/output/AstraPlus.zip'
|
|
|
|
|
}
|
2026-09-06 11:45:41 +03:00
|
|
|
$version = Get-Content -Raw -LiteralPath "$MinecraftDirectory/versions/26.2/26.2.json" | ConvertFrom-Json
|
|
|
|
|
$classpath = @("$MinecraftDirectory/versions/26.2/26.2.jar") + @(
|
|
|
|
|
$version.libraries | Where-Object { $_.downloads.artifact.path } | ForEach-Object {
|
|
|
|
|
"$MinecraftDirectory/libraries/" + $_.downloads.artifact.path
|
|
|
|
|
} | Where-Object { Test-Path -LiteralPath $_ }
|
|
|
|
|
)
|
|
|
|
|
New-Item -ItemType Directory -Force -Path "$repo/build" | Out-Null
|
|
|
|
|
$arguments = @(
|
|
|
|
|
'--class-path', ('"' + (($classpath -join ';').Replace('\', '/')) + '"'),
|
|
|
|
|
('"' + "$PSScriptRoot/CheckSoupModels.java".Replace('\', '/') + '"'),
|
2026-09-08 19:44:45 +03:00
|
|
|
('"' + $ResourcePack.Replace('\', '/') + '"')
|
2026-09-06 11:45:41 +03:00
|
|
|
)
|
|
|
|
|
$argumentFile = "$repo/build/check-models.args"
|
|
|
|
|
Set-Content -Encoding utf8 -LiteralPath $argumentFile -Value $arguments
|
|
|
|
|
& java "@$argumentFile"
|
|
|
|
|
if ($LASTEXITCODE -ne 0) { throw 'Minecraft model validation failed' }
|