blob: 4e44146c84d449794d086a92b803fbfac32489b6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
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
import java.security.MessageDigest
class OfficialMappingDependency(
val side: MCSide,
val version: String,
val dependency: Provider<Dependency>
) : MappingDependency,
Provider<Dependency> by dependency {
override fun updateHash(digest: MessageDigest) {
digest.update("official")
digest.updateField("side", side.toString())
digest.updateField("version", version)
}
override fun title(): String {
return "official-$side-${version.replace(".","_")}"
}
override fun findMapping(files: Set<File>): File? {
return files.singleOrNull {
it.name == "minecraft-${version}-${side}-mappings.txt"
}
}
override fun applyMapping(
mappingsFile: File,
sourceFile: File,
targetFile: File,
sourceNameSpace: String,
targetNameSpace: String
) {
sourceFile.copyTo(targetFile)
}
}
|