diff options
Diffstat (limited to 'plugin/src/main/kotlin/moe/nea/archenemy/mojang/ArchenemySharedExtension.kt')
-rw-r--r-- | plugin/src/main/kotlin/moe/nea/archenemy/mojang/ArchenemySharedExtension.kt | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/plugin/src/main/kotlin/moe/nea/archenemy/mojang/ArchenemySharedExtension.kt b/plugin/src/main/kotlin/moe/nea/archenemy/mojang/ArchenemySharedExtension.kt index 950446d..1e5239b 100644 --- a/plugin/src/main/kotlin/moe/nea/archenemy/mojang/ArchenemySharedExtension.kt +++ b/plugin/src/main/kotlin/moe/nea/archenemy/mojang/ArchenemySharedExtension.kt @@ -16,5 +16,27 @@ abstract class ArchenemySharedExtension(val rootProject: Project) { return rootProject.tasks.getByName("downloadMinecraftVersionManifest") as DownloadMinecraftVersionManifest } + fun getDownloadVersionMetadataTask(version: String): DownloadVersionMetadata { + val taskName = "downloadMinecraftVersionMetadata$version" + val task = rootProject.tasks.findByName(taskName) + if (task != null) { + return task as DownloadVersionMetadata + } + return rootProject.tasks.create(taskName, DownloadVersionMetadata::class.java, version) + } + + fun getDownloadAssetsTask(version: String): DownloadAssets { + val taskName = "downloadMinecraftAssets$version" + val task = rootProject.tasks.findByName(taskName) + if (task != null) { + return task as DownloadAssets + } + return rootProject.tasks.create(taskName, DownloadAssets::class.java, version) + } + + fun getGlobalCacheDirectory(): File { + return rootProject.gradle.gradleUserHomeDir.resolve("caches/archenemy") + } + val minecraftProvider = MinecraftProvider(this) }
\ No newline at end of file |