param( [Parameter(Mandatory = $true)] [ValidatePattern('^[0-9a-fA-F]{40}$')] [string] $PaperCommit ) $propertiesPath = Join-Path $PSScriptRoot "..\gradle.properties" $properties = Get-Content -LiteralPath $propertiesPath -Raw $updated = [regex]::Replace($properties, '(?m)^paperCommit=.*$', "paperCommit=$PaperCommit") if ($updated -eq $properties) { throw "paperCommit was not found in $propertiesPath" } Set-Content -LiteralPath $propertiesPath -Value $updated -NoNewline Write-Output "已将 Paper 固定到 $PaperCommit。合并前请运行 applyAllPatches 和兼容性测试。"