diff --git a/src/main/java/net/fabricmc/loom/decompilers/fernflower/AbstractFernFlowerDecompiler.java b/src/main/java/net/fabricmc/loom/decompilers/fernflower/AbstractFernFlowerDecompiler.java index 61dbaf0..ecc1386 100644 --- a/src/main/java/net/fabricmc/loom/decompilers/fernflower/AbstractFernFlowerDecompiler.java +++ b/src/main/java/net/fabricmc/loom/decompilers/fernflower/AbstractFernFlowerDecompiler.java @@ -100,7 +100,7 @@ public abstract class AbstractFernFlowerDecompiler implements LoomDecompiler { progressGroup.started(); ExecResult result = ForkingJavaExec.javaexec( - project.getRootProject().getPlugins().hasPlugin("fabric-loom") ? project.getRootProject() : project, + project, spec -> { spec.setMain(fernFlowerExecutor().getName()); spec.jvmArgs("-Xms200m", "-Xmx3G"); diff --git a/src/main/java/net/fabricmc/loom/decompilers/fernflower/ForkingJavaExec.java b/src/main/java/net/fabricmc/loom/decompilers/fernflower/ForkingJavaExec.java index 4c0e21a..f7e771d 100644 --- a/src/main/java/net/fabricmc/loom/decompilers/fernflower/ForkingJavaExec.java +++ b/src/main/java/net/fabricmc/loom/decompilers/fernflower/ForkingJavaExec.java @@ -47,15 +47,14 @@ public class ForkingJavaExec { }); } - private static Set getForkedFernflowerClasspath(Project project) { + private static Configuration[] getForkedFernflowerClasspath(Project project) { Set allConfigurations = new HashSet<>(); - Project p = project; + allConfigurations.addAll(project.getBuildscript().getConfigurations()); - do { - allConfigurations.addAll(p.getBuildscript().getConfigurations()); - p = p.getRootProject(); - } while (p != p.getRootProject()); + if (project.getRootProject() != project) { + allConfigurations.addAll(project.getRootProject().getBuildscript().getConfigurations()); + } - return allConfigurations; + return allConfigurations.toArray(new Configuration[0]); } }