-
Notifications
You must be signed in to change notification settings - Fork 17
/
build_dep_ver.gradle
81 lines (75 loc) · 3.56 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
String default_minecraft_version = "1.19.2"
Properties localProperties = new Properties()
String minecraft_version
if (project.rootProject.file('build.properties').exists()) {
localProperties.load(project.rootProject.file('build.properties').newDataInputStream())
}
if (rootProject.properties.containsKey("buildVersion")) {
minecraft_version = rootProject.properties.get("buildVersion")
} else 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)))
minecraft_version = dotted
} else {
minecraft_version = default_minecraft_version
}
rootProject.ext.minecraft_version = minecraft_version
rootProject.ext.minecraft_main_version = minecraft_version.split("\\.")[1] as int
rootProject.ext.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")
rootProject.ext.is_1_19_3 = minecraft_version == "1.19.3" || minecraft_version == "1.19.4"
rootProject.ext.is_1_20 = minecraft_version == "1.20" || minecraft_version == "1.20.1"
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.x"
][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.21)"
][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"
][minecraft_version]
rootProject.ext.fabric_loader_version = "0.15.3"
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"
][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"
][minecraft_version]
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"
][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"
][minecraft_version]
rootProject.ext.architectury_id = minecraft_main_version == 16 ? "me.shedaniel" : "dev.architectury"
rootProject.ext.mtr_min_version = minecraft_version == "1.20.1" ? "0" : minecraft_version + "-" + rootProject.mtr_min_version
rootProject.ext.cloth_config_version = [
"1.16.5": "4.17.101",
"1.17.1": "5.3.63", "1.18.2": "6.5.102",
"1.19.2": "8.3.103", "1.19.3": "9.1.104", "1.19.4": "10.1.105",
"1.20.1": "11.1.106"
][minecraft_version]