diff --git a/gradle/runtime.libs.versions.toml b/gradle/runtime.libs.versions.toml index fe93550da..7031e3056 100644 --- a/gradle/runtime.libs.versions.toml +++ b/gradle/runtime.libs.versions.toml @@ -13,7 +13,7 @@ native-support = "1.0.1" # Forge Runtime depedencies javax-annotations = "3.0.2" -forge-runtime = "2.0.9" +forge-runtime = "2.0.9999" access-transformers = "3.0.1" access-transformers-new = "8.0.5" unprotect = "1.2.0" @@ -37,6 +37,7 @@ javax-annotations = { module = "com.google.code.findbugs:jsr305", version.ref = mixin-remapper-service = { module = "dev.architectury:architectury-mixin-remapper-service", version.ref = "forge-runtime" } naming-service = { module = "dev.architectury:architectury-naming-service", version.ref = "forge-runtime" } mcp-annotations = { module = "dev.architectury:mcp-annotations", version.ref = "forge-runtime" } +reflection-redirector = { module = "dev.architectury:architectury-reflection-redirector", version.ref = "forge-runtime" } access-transformers = { module = "net.minecraftforge:accesstransformers", version.ref = "access-transformers" } access-transformers-new = { module = "net.minecraftforge:accesstransformers", version.ref = "access-transformers-new" } unprotect = { module = "io.github.juuxel:unprotect", version.ref = "unprotect" } diff --git a/src/main/java/net/fabricmc/loom/configuration/LoomConfigurations.java b/src/main/java/net/fabricmc/loom/configuration/LoomConfigurations.java index 509aa975b..02185c66c 100644 --- a/src/main/java/net/fabricmc/loom/configuration/LoomConfigurations.java +++ b/src/main/java/net/fabricmc/loom/configuration/LoomConfigurations.java @@ -167,6 +167,11 @@ public void run() { getDependencies().add(Constants.Configurations.FORGE_EXTRA, LoomVersions.MIXIN_REMAPPER_SERVICE.mavenNotation()); getDependencies().add(Constants.Configurations.FORGE_EXTRA, LoomVersions.MCP_ANNOTATIONS.mavenNotation()); } + + // Add NeoForge-only dev-time dependencies + if (extension.isNeoForge()) { + getDependencies().add(Constants.Configurations.FORGE_EXTRA, LoomVersions.REFLECTION_REDIRECTOR.mavenNotation()); + } } } diff --git a/src/main/java/net/fabricmc/loom/task/launch/GenerateDLIConfigTask.java b/src/main/java/net/fabricmc/loom/task/launch/GenerateDLIConfigTask.java index 5076220ed..0a74f466f 100644 --- a/src/main/java/net/fabricmc/loom/task/launch/GenerateDLIConfigTask.java +++ b/src/main/java/net/fabricmc/loom/task/launch/GenerateDLIConfigTask.java @@ -152,6 +152,13 @@ public void run() throws IOException { } } + if (getExtension().isNeoForge()) { + launchConfig + // See ArchitecturyReflectionRedirectorPlugin in forge-runtime + .property("architectury.reflectionredirector.sourceNamespace", intermediateNs) + .property("architectury.reflectionredirector.mappingsPath", mappingsPath); + } + ForgeRunsProvider forgeRunsProvider = getExtension().getForgeRunsProvider(); ConfigValue.Resolver configResolver = forgeRunsProvider.getResolver(null);