Skip to content

Commit

Permalink
Parse Forge version when legacy is applied, NeoForge otherwise. (#205)
Browse files Browse the repository at this point in the history
  • Loading branch information
shartte authored Dec 15, 2024
1 parent ff0aa42 commit 2f75594
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,14 @@ public void apply(Project project) {
ideIntegration.runTaskOnProjectSync(extension.getIdeSyncTasks());
var dependencyFactory = project.getDependencyFactory();

Provider<VersionCapabilities> versionCapabilities = extension.getVersion().map(VersionCapabilities::ofNeoForgeVersion)
Provider<VersionCapabilities> 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());

Expand Down

0 comments on commit 2f75594

Please sign in to comment.