PaperMC/paperweight

Failed to apply dev bundle patches when building with reobf

Elikill58 opened this issue · 5 comments

When using paperweight since like yesterday, I get this issue:

:executing 'download minecraft manifest'
:executing 'download minecraft version manifest'
:executing 'download vanilla minecraft server jar'
:executing 'download mojang server mappings'
:executing 'extract libraries and server from downloaded jar'
:executing 'filter vanilla server jar'
:executing 'generate mappings'
:executing 'remap minecraft server jar'
:executing 'fix minecraft server jar'
:executing 'access transform minecraft server jar'
:executing 'decompile transformed minecraft server jar'
:executing 'apply patches to decompiled jar'

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':spigot:compileJava'.
> Could not resolve all dependencies for configuration ':spigot:compileClasspath'.
   > Failed to apply dev bundle patches. See the log file at 'C:\Users\dir\to\project\.gradle\caches\paperweight\setupCache\patchedSourcesJar.log' for more details. Usually, the issue is with the dev bundle itself, and not the userdev project.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

The log file is full of things like that:

Patching: net/minecraft/world/scores/ScoreboardSaveData.java
 Hunk 0: EXACT: @@ -143,6 +143,7 @@
Patching: net/minecraft/world/ticks/LevelChunkTicks.java
 Hunk 0: EXACT: @@ -25,6 +25,19 @@
 Hunk 1: EXACT: @@ -50,6 +63,7 @@
 Hunk 2: EXACT: @@ -59,6 +73,7 @@
 Hunk 3: EXACT: @@ -83,7 +98,7 @@
 Hunk 4: EXACT: @@ -101,6 +116,7 @@
 Hunk 5: EXACT: @@ -117,6 +133,11 @@
Patch Summary:
 Un-changed files: 2874
 Changed files:    778
 Missing files:    0

 Failed matches:   1
 Exact matches:    4966
 Access matches:   0
 Offset matches:   0
 Fuzzy matches:    0
Overall Quality   99,98%

Part of my gradle file:

plugins {
    id 'com.github.johnrengelman.shadow'
    id 'io.papermc.paperweight.userdev' version "1.5.7"
}

dependencies {
    paperweightDevelopmentBundle("io.papermc.paper:dev-bundle:1.20.2-R0.1-SNAPSHOT")
    compileOnly "io.papermc.paper:paper-api:1.20.2-R0.1-SNAPSHOT"
}

tasks.assemble.dependsOn(reobfJar)

build.dependsOn shadowJar

parent.tasks.named('shadowJar', ShadowJar) {
    it.from(shadowJar.outputs)
}

I tried to clean cache.

I'm using:

  • Gradle 8.3
  • Java 17.0.1

same issue on my side
does also not work using 1.5.0, 1.5.5 and 1.5.8-SNAPSHOT
applies only to 1.20.2 (tested using 1.19.4, 1.20.1 and 1.20.2)
the cause seems to be the piglin class
image

Same issue

Patching: net/minecraft/world/entity/monster/piglin/Piglin.java
Hunk 0: EXACT: @@ -5,14 +5,6 @@
Hunk 1: EXACT: @@ -54,13 +46,33 @@
Hunk 2: EXACT: @@ -73,7 +85,11 @@
Hunk 3: EXACT: @@ -92,6 +108,14 @@
Hunk 4: FAILURE: @@ -100,6 +124,10 @@

The issue was with dev bundle generation creating invalid bundles, there's no need to update userdev (although it never hurts to run latest).
You just need to use the new dev bundle (can force with --refresh-dependencies when using -SNAPSHOT bundles).
Also, cleanCache should not be needed when updating paperweight or the dev bundle.

The issue was with dev bundle generation creating invalid bundles, there's no need to update userdev (although it never hurts to run latest). You just need to use the new dev bundle (can force with --refresh-dependencies when using -SNAPSHOT bundles). Also, cleanCache should not be needed when updating paperweight or the dev bundle.

its still broken, im using 1.5.9-SNAPSHOT and fully cleared .gradle folder, target folder etc

Patching: net/minecraft/world/entity/monster/piglin/Piglin.java
Hunk 0: EXACT: @@ -5,14 +5,6 @@
Hunk 1: EXACT: @@ -54,13 +46,33 @@
Hunk 2: EXACT: @@ -73,7 +85,11 @@
Hunk 3: EXACT: @@ -92,6 +108,14 @@
Hunk 4: FAILURE: @@ -100,6 +124,10 @@