summaryrefslogtreecommitdiff
path: root/sharedVariables
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-09-24 13:16:55 +0200
committerLinnea Gräf <nea@nea.moe>2024-09-24 13:16:55 +0200
commitfb40ab45f0b4979420bae066da2244f4fdd52db8 (patch)
tree66afc558aade18c996b23da47a02f6726fb656aa /sharedVariables
parent8a5c5d45f87f38d9a7484b73c0505b95e63a21f1 (diff)
downloadultra-notifier-fb40ab45f0b4979420bae066da2244f4fdd52db8.tar.gz
ultra-notifier-fb40ab45f0b4979420bae066da2244f4fdd52db8.tar.bz2
ultra-notifier-fb40ab45f0b4979420bae066da2244f4fdd52db8.zip
snapshot
Diffstat (limited to 'sharedVariables')
-rw-r--r--sharedVariables/src/MappingStyle.kt6
-rw-r--r--sharedVariables/src/MinecraftVersion.kt32
-rw-r--r--sharedVariables/src/Versions.kt59
3 files changed, 82 insertions, 15 deletions
diff --git a/sharedVariables/src/MappingStyle.kt b/sharedVariables/src/MappingStyle.kt
new file mode 100644
index 0000000..deb7fe8
--- /dev/null
+++ b/sharedVariables/src/MappingStyle.kt
@@ -0,0 +1,6 @@
+package moe.nea.sharedbuild
+
+enum class MappingStyle(val identifier: String) {
+ SEARGE("srg"),
+ YARN("yarn"),
+}
diff --git a/sharedVariables/src/MinecraftVersion.kt b/sharedVariables/src/MinecraftVersion.kt
new file mode 100644
index 0000000..a9e8851
--- /dev/null
+++ b/sharedVariables/src/MinecraftVersion.kt
@@ -0,0 +1,32 @@
+package moe.nea.sharedbuild
+
+import org.gradle.jvm.toolchain.JavaLanguageVersion
+
+enum class MinecraftVersion(
+ val versionName: String,
+) {
+ MC189("1.8.9"),
+ MC11200("1.12"),
+ MC11202("1.12.2"),
+ MC1144("1.14.4"),
+ MC11602("1.16.2"),
+ MC11605("1.16.5"),
+ MC12006("1.20.6"),
+ MC121("1.21"),
+ ;
+
+ val versionNumber = run {
+ val parts = versionName.split('.').mapTo(mutableListOf()) { it.toInt() }
+ if (parts.size == 2) parts.add(0)
+ require(parts.size == 3)
+ parts[0] * 10000 + parts[1] * 100 + parts[2]
+ }
+ val javaVersion: Int = when {
+ versionNumber >= 12005 -> 21
+ versionNumber >= 11800 -> 17
+ versionNumber >= 11700 -> 16
+ else -> 8
+ }
+ val javaLanguageVersion = JavaLanguageVersion.of(javaVersion)
+
+}
diff --git a/sharedVariables/src/Versions.kt b/sharedVariables/src/Versions.kt
index bfccd3a..447ac33 100644
--- a/sharedVariables/src/Versions.kt
+++ b/sharedVariables/src/Versions.kt
@@ -5,32 +5,61 @@ private fun yarn(version: String): String =
enum class Versions(
val projectName: String,
- val mappingStyle: String,
- val minecraftVersion: String,
+ val minecraftVersion: MinecraftVersion,
val mappingDependency: String,
- parentName: String?,
+ val mappingStyle: MappingStyle,
val forgeDep: String?,
- val needsPack200: Boolean,
- val isBridge: Boolean,
-
val fabricVersion: String? = null,
+ parentName: String?,
) {
- 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, fabricVersion = "0.23.2+1.14"),
- MC12006("1.20.6", "yarn", "1.20.6", yarn("1.20.6+build.1"), null, null, false, false, fabricVersion = "0.99.0+1.20.6"),
+ MC189("1.8.9",
+ MinecraftVersion.MC189,
+ "de.oceanlabs.mcp:mcp_stable:22-1.8.9@zip",
+ MappingStyle.SEARGE,
+ "net.minecraftforge:forge:1.8.9-11.15.1.2318-1.8.9",
+ null,
+ "MC11202"),
+ MC11202("1.12.2",
+ MinecraftVersion.MC11202,
+ "de.oceanlabs.mcp:mcp_stable:39-1.12@zip",
+ MappingStyle.SEARGE,
+ "net.minecraftforge:forge:1.12.2-14.23.5.2847",
+ null,
+ "MC116Forge"),
+ MC116Forge("1.16.2-forge",
+ MinecraftVersion.MC11602,
+ "official",
+ MappingStyle.SEARGE,
+ "net.minecraftforge:forge:1.16.2-33.0.61",
+ null,
+ "MC116Fabric"),
+ MC116Fabric("1.16.2-fabric",
+ MinecraftVersion.MC11602,
+ yarn("1.16.2+build.47"),
+ MappingStyle.YARN,
+ null,
+ "0.20.1+build.401-1.16",
+ "MC12006"
+ ),
+ MC12006(
+ "1.20.6",
+ MinecraftVersion.MC12006,
+ yarn("1.20.6+build.1"),
+ MappingStyle.YARN,
+ null,
+ fabricVersion = "0.99.0+1.20.6",
+ null,
+ ),
;
+ val platformName = if (forgeDep == null) "fabric" else "forge"
+ val universalCraft = "gg.essential:universalcraft-${minecraftVersion.versionName}-$platformName:363"
+ val needsPack200 = forgeDep != null && minecraftVersion <= MinecraftVersion.MC11202
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 {