Add support for anchors, hooks, and hook injection in patching logic with comprehensive tests.
ci / image (42.21, public) (push) Successful in 1m43s

Added onServerStarted Hook and Patch.
This commit is contained in:
Overlord committed 2026-09-30 21:59:22 +02:00
1 parent e13132c202
commit 2b94a49352
19 files changed
+972 -62

No files matched your search

+6
View File
@@ -39,12 +39,18 @@ tasks.register<JavaExec>("patchServerJar") {
val vanillaJar = projectZomboid.serverJar
val patchedJar = layout.buildDirectory.file("server/projectzomboid.jar")
val expectedVersion = projectZomboid.version
// Simple class names of patches to skip, e.g. -Pzf.disabledPatches=ServerStartedPatch (debug builds).
val disabledPatches = providers.gradleProperty("zf.disabledPatches").orElse("")
inputs.property("disabledPatches", disabledPatches)
inputs.file(vanillaJar).withPropertyName("vanillaJar")
inputs.property("expectedVersion", expectedVersion)
outputs.file(patchedJar).withPropertyName("patchedJar")
classpath = sourceSets.main.get().runtimeClasspath + serverPatches
mainClass = "dev.overlord.zomboidforge.patcher.JarPatcher"
jvmArgumentProviders.add(CommandLineArgumentProvider {
listOf("-Dzomboidforge.disabledPatches=${disabledPatches.get()}")
})
argumentProviders.add(CommandLineArgumentProvider {
listOf(
vanillaJar.get().asFile.absolutePath,