diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/MinecraftSourceSets.java b/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/MinecraftSourceSets.java index 1e049343..1893703a 100644 --- a/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/MinecraftSourceSets.java +++ b/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/MinecraftSourceSets.java @@ -37,6 +37,7 @@ import org.gradle.api.tasks.SourceSet; import org.gradle.jvm.tasks.Jar; import net.fabricmc.loom.LoomGradleExtension; +import net.fabricmc.loom.task.AbstractRemapJarTask; import net.fabricmc.loom.util.Constants; public abstract sealed class MinecraftSourceSets permits MinecraftSourceSets.Single, MinecraftSourceSets.Split { @@ -201,6 +202,13 @@ public abstract sealed class MinecraftSourceSets permits MinecraftSourceSets.Sin jar.from(clientOnlySourceSet.getOutput().getResourcesDir()); }); + // Remap with the client compile classpath. + project.getTasks().withType(AbstractRemapJarTask.class).configureEach(remapJarTask -> { + remapJarTask.getClasspath().from( + project.getConfigurations().getByName(clientOnlySourceSet.getCompileClasspathConfigurationName()) + ); + }); + if (project.getTasks().findByName(mainSourceSet.getSourcesJarTaskName()) == null) { // No sources. return; diff --git a/src/main/java/net/fabricmc/loom/task/service/TinyRemapperService.java b/src/main/java/net/fabricmc/loom/task/service/TinyRemapperService.java index 4e4c33ff..cd780ee7 100644 --- a/src/main/java/net/fabricmc/loom/task/service/TinyRemapperService.java +++ b/src/main/java/net/fabricmc/loom/task/service/TinyRemapperService.java @@ -26,6 +26,7 @@ package net.fabricmc.loom.task.service; import java.io.File; import java.io.IOException; +import java.nio.file.Files; import java.nio.file.Path; import java.util.ArrayList; import java.util.HashMap; @@ -85,7 +86,7 @@ public class TinyRemapperService implements SharedService { return new TinyRemapperService(mappings, !legacyMixin, kotlinClasspathService); }); - service.readClasspath(remapJarTask.getClasspath().getFiles().stream().map(File::toPath).toList()); + service.readClasspath(remapJarTask.getClasspath().getFiles().stream().map(File::toPath).filter(Files::exists).toList()); return service; }