summaryrefslogtreecommitdiff
path: root/plugin/src/main/kotlin/moe/nea/archenemy/mojang
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/src/main/kotlin/moe/nea/archenemy/mojang')
-rw-r--r--plugin/src/main/kotlin/moe/nea/archenemy/mojang/IdentityMinecraftTransformer.kt1
-rw-r--r--plugin/src/main/kotlin/moe/nea/archenemy/mojang/MappedRepositoryProvider.kt3
-rw-r--r--plugin/src/main/kotlin/moe/nea/archenemy/mojang/MinecraftProvider.kt14
-rw-r--r--plugin/src/main/kotlin/moe/nea/archenemy/mojang/OfficialMappingDependency.kt2
4 files changed, 6 insertions, 14 deletions
diff --git a/plugin/src/main/kotlin/moe/nea/archenemy/mojang/IdentityMinecraftTransformer.kt b/plugin/src/main/kotlin/moe/nea/archenemy/mojang/IdentityMinecraftTransformer.kt
index 9d23c60..bb7a5cb 100644
--- a/plugin/src/main/kotlin/moe/nea/archenemy/mojang/IdentityMinecraftTransformer.kt
+++ b/plugin/src/main/kotlin/moe/nea/archenemy/mojang/IdentityMinecraftTransformer.kt
@@ -1,5 +1,6 @@
package moe.nea.archenemy.mojang
+import moe.nea.archenemy.util.update
import java.io.File
import java.security.MessageDigest
diff --git a/plugin/src/main/kotlin/moe/nea/archenemy/mojang/MappedRepositoryProvider.kt b/plugin/src/main/kotlin/moe/nea/archenemy/mojang/MappedRepositoryProvider.kt
index d176d45..ddfff0d 100644
--- a/plugin/src/main/kotlin/moe/nea/archenemy/mojang/MappedRepositoryProvider.kt
+++ b/plugin/src/main/kotlin/moe/nea/archenemy/mojang/MappedRepositoryProvider.kt
@@ -1,7 +1,8 @@
package moe.nea.archenemy.mojang
-import moe.nea.archenemy.DownloadUtils
+import moe.nea.archenemy.util.DownloadUtils
import moe.nea.archenemy.util.getNullsafeIdentifier
+import moe.nea.archenemy.util.updateField
import net.minecraftforge.artifactural.api.artifact.Artifact
import net.minecraftforge.artifactural.api.artifact.ArtifactIdentifier
import net.minecraftforge.artifactural.api.artifact.ArtifactType
diff --git a/plugin/src/main/kotlin/moe/nea/archenemy/mojang/MinecraftProvider.kt b/plugin/src/main/kotlin/moe/nea/archenemy/mojang/MinecraftProvider.kt
index 64c1d04..605d485 100644
--- a/plugin/src/main/kotlin/moe/nea/archenemy/mojang/MinecraftProvider.kt
+++ b/plugin/src/main/kotlin/moe/nea/archenemy/mojang/MinecraftProvider.kt
@@ -2,7 +2,7 @@ package moe.nea.archenemy.mojang
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.decodeFromStream
-import moe.nea.archenemy.DownloadUtils
+import moe.nea.archenemy.util.DownloadUtils
import moe.nea.archenemy.MCSide
import moe.nea.archenemy.util.getNullsafeIdentifier
import net.minecraftforge.artifactural.api.artifact.Artifact
@@ -14,20 +14,8 @@ import net.minecraftforge.artifactural.base.artifact.StreamableArtifact
import java.io.File
import java.io.IOException
import java.net.URL
-import java.security.MessageDigest
import java.util.concurrent.ConcurrentHashMap
-fun MessageDigest.updateField(text: String, value: String) {
- this.update(text)
- this.update(":")
- this.update(value)
- this.update(";")
-}
-
-fun MessageDigest.update(text: String) {
- this.update(text.encodeToByteArray())
-}
-
class MinecraftProvider(val sharedExtension: ArchenemySharedExtension) : Repository {
data class MinecraftCoordinate(
diff --git a/plugin/src/main/kotlin/moe/nea/archenemy/mojang/OfficialMappingDependency.kt b/plugin/src/main/kotlin/moe/nea/archenemy/mojang/OfficialMappingDependency.kt
index 8617ede..4e44146 100644
--- a/plugin/src/main/kotlin/moe/nea/archenemy/mojang/OfficialMappingDependency.kt
+++ b/plugin/src/main/kotlin/moe/nea/archenemy/mojang/OfficialMappingDependency.kt
@@ -1,6 +1,8 @@
package moe.nea.archenemy.mojang
import moe.nea.archenemy.MCSide
+import moe.nea.archenemy.util.update
+import moe.nea.archenemy.util.updateField
import org.gradle.api.artifacts.Dependency
import org.gradle.api.provider.Provider
import java.io.File