FabricMC / fabric-loom

Gradle build system plugin used to automate the setup of a minecraft mod development environment.
MIT License
221 stars 193 forks source link

Decompiler cache doesn't work with Mojang mappings #1121

Closed VelizarBG closed 1 month ago

VelizarBG commented 1 month ago

Reusing the decompiler cache for sources mapped with Mojang mappings doesn't work. This might have something to do with cached classes being mapped in obfuscated ProGuard mappings, instead of Mojang mappings.

Here is the stacktrace.

Steps to reproduce

  1. Delete your decompiler cache.
  2. Clone the reproduction repo.
  3. Checkout the 1.20.6-mojmap branch.
  4. Run gradlew genSourcesWithVineflower --use-cache
  5. Run gradlew genSourcesWithVineflower --use-cache --full-stacktrace
VelizarBG commented 1 month ago

@modmuss50 The error is gone but the cached classes still get saved with obfuscated mappings.

modmuss50 commented 1 month ago

@modmuss50 The error is gone but the cached classes still get saved with obfuscated mappings.

Im not 100% sure what you mean? Can you try running build --refresh-dependencies and see if that helps?

What does you build.gradle look like, im testing with:

loom {
    noIntermediateMappings()
}

dependencies {
    minecraft "com.mojang:minecraft:1.20.4"
    mappings loom.officialMojangMappings()
    modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
}
VelizarBG commented 1 month ago

Hmm, --refresh-dependencies seems to have gotten rid of the issue(basically almost every class used to be obfuscated). You can see my build.gradle in the branch from the reproduction repo linked in the steps for reproduction above. Anyway, thanks for fixing this!

modmuss50 commented 1 month ago

Awesome, I think what happened was it had cached a broken copy of the jar from an older loom version. Im glad its working now. Have fun 👍