diff --git a/plugin/src/main/java/com/gtnewhorizons/retrofuturagradle/mcp/MCPTasks.java b/plugin/src/main/java/com/gtnewhorizons/retrofuturagradle/mcp/MCPTasks.java index 32282d37..8dc10248 100644 --- a/plugin/src/main/java/com/gtnewhorizons/retrofuturagradle/mcp/MCPTasks.java +++ b/plugin/src/main/java/com/gtnewhorizons/retrofuturagradle/mcp/MCPTasks.java @@ -478,12 +478,12 @@ public MCPTasks(Project project, MinecraftExtension mcExt, MinecraftTasks mcTask set -> { set.getJava().setSrcDirs(project.files(injectedSourcesLocation).builtBy(taskInjectTags)); }); project.getTasks().named(injectedSourceSet.getCompileJavaTaskName()) .configure(task -> task.dependsOn(taskInjectTags)); - mainSet.setCompileClasspath(mainSet.getCompileClasspath().plus(injectedSourceSet.getOutput())); - mainSet.setRuntimeClasspath( - mainSet.getRuntimeClasspath().plus(injectedSourceSet.getOutput()).plus(launcherSources.getOutput())); - testSet.setCompileClasspath(testSet.getCompileClasspath().plus(injectedSourceSet.getOutput())); - testSet.setRuntimeClasspath( - testSet.getRuntimeClasspath().plus(injectedSourceSet.getOutput()).plus(launcherSources.getOutput())); + final FileCollection mcCp = launcherSources.getOutput().plus(patchedMcSources.getOutput()); + final FileCollection extraCp = mcCp.plus(injectedSourceSet.getOutput()); + mainSet.setCompileClasspath(mainSet.getCompileClasspath().plus(extraCp)); + mainSet.setRuntimeClasspath(mainSet.getRuntimeClasspath().plus(extraCp)); + testSet.setCompileClasspath(testSet.getCompileClasspath().plus(extraCp)); + testSet.setRuntimeClasspath(testSet.getRuntimeClasspath().plus(extraCp)); project.getTasks().named("jar", Jar.class) .configure(task -> task.from(injectedSourceSet.getOutput().getAsFileTree())); @@ -1070,14 +1070,6 @@ private void afterEvaluate() { task.getPatches().from(userdevFile("patches.zip")); } }); - - final SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class); - final SourceSet mainSet = sourceSets.getByName(SourceSet.MAIN_SOURCE_SET_NAME); - final ConfigurableFileCollection mcCp = project.getObjects().fileCollection(); - mcCp.from(launcherSources.getOutput()); - mcCp.from(patchedMcSources.getOutput()); - mainSet.setCompileClasspath(mainSet.getCompileClasspath().plus(mcCp)); - mainSet.setRuntimeClasspath(mainSet.getRuntimeClasspath().plus(mcCp)); } } }