From 2f7559495ebbe4cd2798585b13f64e9f657d6dd1 Mon Sep 17 00:00:00 2001 From: shartte Date: Sun, 15 Dec 2024 23:54:50 +0100 Subject: [PATCH] Parse Forge version when legacy is applied, NeoForge otherwise. (#205) --- .../neoforged/moddevgradle/internal/ModDevPlugin.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/neoforged/moddevgradle/internal/ModDevPlugin.java b/src/main/java/net/neoforged/moddevgradle/internal/ModDevPlugin.java index 55881d8d..9fcad017 100644 --- a/src/main/java/net/neoforged/moddevgradle/internal/ModDevPlugin.java +++ b/src/main/java/net/neoforged/moddevgradle/internal/ModDevPlugin.java @@ -153,7 +153,14 @@ public void apply(Project project) { ideIntegration.runTaskOnProjectSync(extension.getIdeSyncTasks()); var dependencyFactory = project.getDependencyFactory(); - Provider versionCapabilities = extension.getVersion().map(VersionCapabilities::ofNeoForgeVersion) + Provider versionCapabilities = extension.getVersion().map(v -> { + // Temporary until we have imperative configuration + if (project.getPlugins().hasPlugin("net.neoforged.moddev.legacyforge")) { + return VersionCapabilities.ofForgeVersion(v); + } else { + return VersionCapabilities.ofNeoForgeVersion(v); + } + }) .orElse(extension.getNeoFormVersion().map(VersionCapabilities::ofNeoFormVersion)) .orElse(VersionCapabilities.latest());