feat: protect mod payloads with main-thread ownership in 1.1.17

This commit is contained in:
Disy committed 2026-10-06 17:36:00 +08:00
1 parent 691e949691
commit 763c015103
29 files changed
+1552 -53

No files matched your search

+43
View File
@@ -77,9 +77,52 @@ dependencies {
}
// Opt-in isolated runtime fixture; excluded from normal builds.
if (providers.gradleProperty('payloadRegression').isPresent()) {
if (providers.gradleProperty('reviewRegression').isPresent()) {
runs.configureEach { systemProperty 'dimensionalripper.reviewRegression', 'true' }
}
if (providers.gradleProperty('interactionRegression').isPresent() || providers.gradleProperty('ownershipRegression').isPresent()) {
throw new GradleException('Run payloadRegression separately.')
}
sourceSets.main.java.srcDir('tests/payload')
if (providers.gradleProperty('payloadModsDir').isPresent()) {
dependencies {
runtimeOnly fileTree(dir: providers.gradleProperty('payloadModsDir').get(), includes: [
'create-1.21.1-6.0.10.starlight.jar', 'create-aeronautics-bundled-1.21.1-1.3.0.starlight.jar',
'sable-neoforge-1.21.1-2.0.5.starlight.jar', 'veil-neoforge-1.21.1-4.2.0.starlight.jar',
'Jade-1.21.1-NeoForge-15.10.5.starlight.jar'
])
}
}
tasks.matching { it.name == 'runServer' }.configureEach {
doLast {
def output = file('runs/server/logs/latest.log').getText('UTF-8')
if (providers.gradleProperty('reviewRegression').isPresent()) {
if (!output.contains('PAYLOAD REVIEW PASS') || output.contains('Encountered an unexpected exception'))
throw new GradleException('Payload review regression did not pass.')
return
}
if (!['PAYLOAD PHASE PASS', 'PAYLOAD ENTRY PASS', 'PAYLOAD ASYNC PASS', 'PAYLOAD LIFECYCLE PASS', 'PAYLOAD DIAGNOSTICS PASS'].every { output.contains(it) }
|| output.contains('Encountered an unexpected exception'))
throw new GradleException('Payload phase regression did not pass.')
if (providers.gradleProperty('payloadModsDir').isPresent()
&& !['SIMULATED HANDLE PACKET PASS', 'CREATE CONFIG PASS', 'JADE REQUEST PASS'].every { output.contains(it) })
throw new GradleException('Real Simulated/Create/Jade packet regression did not pass.')
}
}
}
if (providers.gradleProperty('interactionRegression').isPresent()) {
sourceSets.main.java.srcDir('tests/integration')
sourceSets.main.java.exclude('**/ChunkHandoffRegression.java')
tasks.matching { it.name == 'runServer' }.configureEach {
doLast {
def output = file('runs/server/logs/latest.log').getText('UTF-8')
if (!['ENTITY ROUTING REGRESSION PASS', 'MISSING CHUNK REGRESSION PASS',
'REQUIRED CHUNK REGRESSION PASS', 'INTERACTION REGRESSION PASS'].every { output.contains(it) }
|| output.contains('Encountered an unexpected exception'))
throw new GradleException('Interaction/water regression did not pass.')
}
}
}
if (providers.gradleProperty('ownershipRegression').isPresent()) {
if (providers.gradleProperty('interactionRegression').isPresent()) {