summaryrefslogtreecommitdiff
path: root/sharedVariables/src/Versions.kt
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-05-21 21:17:41 +0200
committerLinnea Gräf <nea@nea.moe>2024-05-21 21:17:41 +0200
commitf25b818d9d41e2bb3969399cfc8bbff976b5aad7 (patch)
tree5f9137b374dfca42f596851c85116c9da181fa50 /sharedVariables/src/Versions.kt
downloadultra-notifier-f25b818d9d41e2bb3969399cfc8bbff976b5aad7.tar.gz
ultra-notifier-f25b818d9d41e2bb3969399cfc8bbff976b5aad7.tar.bz2
ultra-notifier-f25b818d9d41e2bb3969399cfc8bbff976b5aad7.zip
Init
Diffstat (limited to 'sharedVariables/src/Versions.kt')
-rw-r--r--sharedVariables/src/Versions.kt39
1 files changed, 39 insertions, 0 deletions
diff --git a/sharedVariables/src/Versions.kt b/sharedVariables/src/Versions.kt
new file mode 100644
index 0000000..f559d03
--- /dev/null
+++ b/sharedVariables/src/Versions.kt
@@ -0,0 +1,39 @@
+package moe.nea.sharedbuild
+
+private fun yarn(version: String): String =
+ "net.fabricmc:yarn:${version}:v2"
+
+enum class Versions(
+ val projectName: String,
+ val mappingStyle: String,
+ val minecraftVersion: String,
+ val mappingDependency: String,
+ parentName: String?,
+ val forgeDep: String?,
+ val needsPack200: Boolean,
+ val isBridge: Boolean,
+) {
+ MC189("1.8.9", "srg", "1.8.9", "de.oceanlabs.mcp:mcp_stable:22-1.8.9@zip", "MC11404F", "net.minecraftforge:forge:1.8.9-11.15.1.2318-1.8.9", true, false),
+ MC11404F("1.14.4-forge", "srg", "1.14.4", "de.oceanlabs.mcp:mcp_stable:58-1.14.4@zip", "MC11404", "net.minecraftforge:forge:1.14.4-28.1.113", false, true),
+ MC11404("1.14.4", "yarn", "1.14.4", yarn("1.14.4+build.1"), "MC12006", null, false, true),
+ MC12006("1.20.6", "yarn", "1.20.6", yarn("1.20.6+build.1"), null, null, false, false),
+ ;
+
+ val parent: Versions? by lazy {
+ if (parentName == null) null
+ else Versions.values().find { it.name == parentName }!!
+ }
+
+ val numericMinecraftVersion = run {
+ require(minecraftVersion.count { it == '.' } == 2)
+ val (a, b, c) = minecraftVersion.split(".").map { it.toInt() }
+ a * 10000 + b * 100 + c
+ }
+ val projectPath get() = ":$projectName"
+
+ companion object {
+ init {
+ values().forEach { it.parent }
+ }
+ }
+}