diff options
Diffstat (limited to 'plugin/src/main/kotlin/moe/nea/archenemy/mojang/ArchenemyMojangExtension.kt')
-rw-r--r-- | plugin/src/main/kotlin/moe/nea/archenemy/mojang/ArchenemyMojangExtension.kt | 23 |
1 files changed, 22 insertions, 1 deletions
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 8125900..e1a8bfe 100644 --- a/plugin/src/main/kotlin/moe/nea/archenemy/mojang/ArchenemyMojangExtension.kt +++ b/plugin/src/main/kotlin/moe/nea/archenemy/mojang/ArchenemyMojangExtension.kt @@ -21,9 +21,15 @@ abstract class ArchenemyMojangExtension(val project: Project) { GradleRepositoryAdapter.add( project.repositories, "Minecraft Mapped Provider", - getLocalCacheDirectory().resolve("minecraft-transformation-provider"), + getLocalCacheDirectory().resolve("minecraft-mapped-provider"), mappedRepositoryProvider ) + GradleRepositoryAdapter.add( + project.repositories, + "Minecraft Merged Provider", + getLocalCacheDirectory().resolve("minecraft-merged-provider"), + mergedRepositoryProvider + ) project.repositories.maven { it.name = "Minecraft Libraries" it.url = URI("https://libraries.minecraft.net/") @@ -31,6 +37,7 @@ abstract class ArchenemyMojangExtension(val project: Project) { } private val mappedRepositoryProvider = MappedRepositoryProvider(this) + private val mergedRepositoryProvider = MergedRepositoryProvider(this) fun yarnMappings(dependency: Dependency): MappingDependency { dependency as ModuleDependency @@ -56,6 +63,20 @@ abstract class ArchenemyMojangExtension(val project: Project) { return yarnMappings(project.dependencies.create("net.fabricmc:intermediary:$version:v2")) } + fun mergeJar( + base: Dependency, + overlay: Dependency, + ): Dependency { + base as ModuleDependency + overlay as ModuleDependency + _registerMinecraftProvider + return project.dependencies.create( + mergedRepositoryProvider.getCoordinate( + MergedRepositoryProvider.Coordinate(base, overlay) + ) + ) + } + fun mapJar( dependency: Dependency, mappings: MappingDependency, |