From 17b7894e6ccfe1c3798b173283d8f0cfae2423c9 Mon Sep 17 00:00:00 2001 From: LexManos Date: Thu, 29 Feb 2024 14:00:13 -0800 Subject: [PATCH] Bump AF --- build.gradle | 2 +- .../common/util/runs/RunConfigGenerator.java | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 198961609..33fb486f3 100644 --- a/build.gradle +++ b/build.gradle @@ -73,7 +73,7 @@ dependencies { commonImplementation 'com.google.code.gson:gson:2.10.1' commonImplementation 'com.google.guava:guava:31.1-jre' commonImplementation 'de.siegmar:fastcsv:2.2.1' - commonImplementation('net.minecraftforge:artifactural:3.0.16') { + commonImplementation('net.minecraftforge:artifactural:3.0.18') { transitive = false } commonImplementation('net.minecraftforge:unsafe:0.2.0') { diff --git a/src/common/java/net/minecraftforge/gradle/common/util/runs/RunConfigGenerator.java b/src/common/java/net/minecraftforge/gradle/common/util/runs/RunConfigGenerator.java index 8ebc1bcac..f181b9ac1 100644 --- a/src/common/java/net/minecraftforge/gradle/common/util/runs/RunConfigGenerator.java +++ b/src/common/java/net/minecraftforge/gradle/common/util/runs/RunConfigGenerator.java @@ -144,9 +144,17 @@ protected static Map> configureTokensLazy(final Project Map> tokens = new HashMap<>(); runConfig.getTokens().forEach((k, v) -> tokens.put(k, () -> v)); runConfig.getLazyTokens().forEach((k, v) -> tokens.put(k, Suppliers.memoize(v::get))); - tokens.compute("source_roots", (key, sourceRoots) -> Suppliers.memoize(() -> ((sourceRoots != null) - ? Stream.concat(Arrays.stream(sourceRoots.get().split(File.pathSeparator)), modClasses) - : modClasses).distinct().collect(Collectors.joining(File.pathSeparator)))); + tokens.compute("source_roots", (k, v) -> { + Stream paths; + if (v == null) + paths = modClasses; + else { + String[] existing = v.get().split(File.pathSeparator); + paths = Stream.concat(Arrays.stream(existing), modClasses); + } + + return Suppliers.memoize(() -> paths.distinct().collect(Collectors.joining(File.pathSeparator))); + }); Supplier runtimeClasspath = tokens.compute("runtime_classpath", makeClasspathToken(runtimeClasspathArtifacts)); Supplier minecraftClasspath = tokens.compute("minecraft_classpath", makeClasspathToken(minecraftArtifacts));