diff --git a/paperweight-core/src/main/kotlin/io/papermc/paperweight/core/tasks/patching/ApplySingleFilePatches.kt b/paperweight-core/src/main/kotlin/io/papermc/paperweight/core/tasks/patching/ApplySingleFilePatches.kt index c35959967..bacd49785 100644 --- a/paperweight-core/src/main/kotlin/io/papermc/paperweight/core/tasks/patching/ApplySingleFilePatches.kt +++ b/paperweight-core/src/main/kotlin/io/papermc/paperweight/core/tasks/patching/ApplySingleFilePatches.kt @@ -124,11 +124,13 @@ abstract class ApplySingleFilePatches : BaseTask() { .rejectsPath(tmpRej) .build() - if (op.operate().exit != 0) { - return@use "Patch failed on ${patch.patchFile.path}, see log above. Rejects at $tmpRej" - } + val result = op.operate() workFile.copyTo(patch.outputFile.path.createParentDirectories(), true) + + if (result.exit != 0) { + return@use "Patch failed on ${patch.patchFile.path}, see log above. Rejects at $tmpRej" + } } else { upstream.path.resolve(patch.path.get()) .copyTo(patch.outputFile.path.createParentDirectories(), true)