From 9058126b0d77c315436226a589ade0748d8a2905 Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Sun, 10 Dec 2023 21:02:07 +0100 Subject: Add intermediary mappings --- archenemyexample/build.gradle.kts | 2 +- .../kotlin/moe/nea/archenemy/mojang/ArchenemyMojangExtension.kt | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/archenemyexample/build.gradle.kts b/archenemyexample/build.gradle.kts index 946264e..fae9a49 100644 --- a/archenemyexample/build.gradle.kts +++ b/archenemyexample/build.gradle.kts @@ -14,7 +14,7 @@ val officialMappings = mojang.officialMappings( "1.20.2", MCSide.CLIENT ) val yarnMappings = mojang.yarnMappings(dependencies.create("net.fabricmc:yarn:1.20.2+build.4:v2")) -val intermediaryMappings = mojang.yarnMappings(dependencies.create("net.fabricmc:intermediary:1.20.2:v2")) +val intermediaryMappings = mojang.intermediaryMappings("1.20.2") val whateverAttribute = Attribute.of("whatever", String::class.java) kotlin { diff --git a/plugin/src/main/kotlin/moe/nea/archenemy/mojang/ArchenemyMojangExtension.kt b/plugin/src/main/kotlin/moe/nea/archenemy/mojang/ArchenemyMojangExtension.kt index db667ae..8125900 100644 --- a/plugin/src/main/kotlin/moe/nea/archenemy/mojang/ArchenemyMojangExtension.kt +++ b/plugin/src/main/kotlin/moe/nea/archenemy/mojang/ArchenemyMojangExtension.kt @@ -52,12 +52,17 @@ abstract class ArchenemyMojangExtension(val project: Project) { return OfficialMappingDependency(side, version, project.providers.provider { dependency }) } + fun intermediaryMappings(version: String): MappingDependency { + return yarnMappings(project.dependencies.create("net.fabricmc:intermediary:$version:v2")) + } + fun mapJar( - dependency: ModuleDependency, + dependency: Dependency, mappings: MappingDependency, sourceNamespace: String, destinationNamespace: String ): Dependency { + dependency as ModuleDependency _registerMinecraftProvider return project.dependencies.create( mappedRepositoryProvider.getDependencyCoordiante( -- cgit