-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild_dep_ver.gradle
93 lines (86 loc) · 3.96 KB
/
build_dep_ver.gradle
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
def getMinecraftVersion() {
String default_minecraft_version = "1.19.2"
Properties localProperties = new Properties()
String minecraft_version; int minecraft_version_int
if (new File(rootDir, 'build.properties').exists()) {
localProperties.load(new File(rootDir, 'build.properties').newDataInputStream())
}
if (localProperties.containsKey("MC_VERSION")) {
String notDotted = localProperties.get("MC_VERSION")
String dotted = notDotted.substring(0, 1) + "." +
Integer.toString(Integer.parseInt(notDotted.substring(1, 3))) + "." +
Integer.toString(Integer.parseInt(notDotted.substring(3, 5)))
if (dotted.endsWith(".0")) {
dotted = dotted.substring(0, dotted.length() - 2)
}
minecraft_version = dotted
} else {
minecraft_version = rootProject.properties.containsKey("buildVersion") ? rootProject.properties.get("buildVersion") : default_minecraft_version
}
minecraft_version_int = (minecraft_version.split("\\.")[0] +
minecraft_version.split("\\.")[1].padLeft(2, '0') +
(minecraft_version.split("\\.").length > 2 ? minecraft_version.split("\\.")[2].padLeft(2, '0') : "00"))
.toInteger()
return [minecraft_version, minecraft_version_int]
}
String minecraft_version; int minecraft_version_int
(minecraft_version, minecraft_version_int) = getMinecraftVersion()
rootProject.ext.minecraft_version = minecraft_version
rootProject.ext.minecraft_main_version = minecraft_version.split("\\.")[1] as int
rootProject.ext.minecraft_version_int = minecraft_version_int
rootProject.ext.supports_minecraft_version = [
"1.16.5": "1.16.x",
"1.17.1": "1.17.x", "1.18.2": "1.18.x",
"1.19.2": "1.19.2", "1.19.3": "1.19.3", "1.19.4": "1.19.4",
"1.20.1": "1.20.1", "1.20.4": "1.20.4",
"1.21.1": ">=1.21 <=1.21.1",
][minecraft_version]
rootProject.ext.supports_minecraft_version_range = [
"1.16.5": "[1.16, 1.17)",
"1.17.1": "[1.17, 1.18)", "1.18.2": "[1.18, 1.19)",
"1.19.2": "1.19.2", "1.19.3": "1.19.3", "1.19.4": "1.19.4",
"1.20.1": "1.20.1", "1.20.4": "1.20.4",
"1.21.1": "[1.21, 1.21.1]"
][minecraft_version]
rootProject.ext.parchment_version = [
"1.16.5": "2022.03.06",
"1.17.1": "2021.12.12", "1.18.2": "2022.11.06",
"1.19.2": "2022.11.27", "1.19.3": "2023.06.25", "1.19.4": "2023.06.26",
"1.20.1": "2023.09.03", "1.20.4": "2024.04.14",
"1.21.1": "2024.11.17"
][minecraft_version]
rootProject.ext.fabric_loader_version = "0.15.11"
rootProject.ext.fabric_api_version = [
"1.16.5": "0.42.0",
"1.17.1": "0.46.1+1.17", "1.18.2": "0.77.0+1.18.2",
"1.19.2": "0.77.0+1.19.2", "1.19.3": "0.76.1+1.19.3", "1.19.4": "0.87.2+1.19.4",
"1.20.1": "0.91.0+1.20.1", "1.20.4": "0.93.1+1.20.4",
"1.21.1": "0.102.1+1.21.1"
][minecraft_version]
rootProject.ext.mod_menu_version = [
"1.16.5": "1.16.23",
"1.17.1": "2.0.17", "1.18.2": "3.2.5",
"1.19.2": "4.1.2", "1.19.3": "5.1.0", "1.19.4": "6.3.1",
"1.20.1": "7.2.2", "1.20.4": "9.0.0",
"1.21.1": "11.0.3"
][minecraft_version]
if (minecraft_version_int < 12100) {
rootProject.ext.forge_version = minecraft_version + "-" + [
"1.16.5": "36.2.34",
"1.17.1": "37.1.1", "1.18.2": "40.2.0",
"1.19.2": "43.3.0", "1.19.3": "44.1.0", "1.19.4": "45.2.0",
"1.20.1": "47.2.0", "1.20.4": "49.0.19"
][minecraft_version]
} else {
rootProject.ext.forge_version = [
"1.21.1" : "21.1.35"
][minecraft_version]
}
rootProject.ext.architectury_version = [
"1.16.5": "1.32.68",
"1.17.1": "2.10.12", "1.18.2": "4.11.93",
"1.19.2": "6.5.85", "1.19.3": "7.1.86", "1.19.4": "8.2.89",
"1.20.1": "9.1.12", "1.20.4": "11.0.11",
"1.21.1": "13.0.8"
][minecraft_version]
rootProject.ext.architectury_id = minecraft_main_version == 16 ? "me.shedaniel" : "dev.architectury"