You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: buildSrc/src/main/kotlin/org/polyfrost/gradle/addDependencies.kt
+29-14Lines changed: 29 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,6 @@ private val legacyFabricApiModules = listOf(
14
14
privateval fabricApiModules =listOf( // command-api-v2 introduced in 1.19, transitive-access-wideners-v1 introduced in 1.18
15
15
"api-base",
16
16
"lifecycle-events-v1",
17
-
"key-binding-api-v1",
18
17
"rendering-v1",
19
18
"screen-api-v1"
20
19
)
@@ -43,6 +42,7 @@ private val fabricApiModuleVersions = mapOf(
43
42
"api-base-12109" to "0.5.2+2fa446b294", // 1.21.9
44
43
"api-base-12110" to "1.0.0+14b92d8968", // 1.21.10
45
44
"api-base-12111" to "1.0.5+4ebb5c0853", // 1.21.11
45
+
"api-base-260100" to "2.0.0+574290ba7d", // 26.1
46
46
"lifecycle-events-v1-common" to "1.1.0+2c3f108c81e6", // Common (Legacy Fabric API)
47
47
"lifecycle-events-v1-10809" to "1.1.0+1.8.9+2c3f108c81e6", // 1.8.9
48
48
"lifecycle-events-v1-11202" to "1.1.0+1.12.2+2c3f108c81e6", // 1.12.2
@@ -65,6 +65,7 @@ private val fabricApiModuleVersions = mapOf(
65
65
"lifecycle-events-v1-12109" to "2.6.8+33df5e6e94", // 1.21.9
66
66
"lifecycle-events-v1-12110" to "2.6.9+33df5e6e68", // 1.21.10
67
67
"lifecycle-events-v1-12111" to "2.6.15+4ebb5c0853", // 1.21.11
68
+
"lifecycle-events-v1-260100" to "4.0.2+a208210e7d", // 26.1
68
69
"keybindings-api-v1-common" to "1.1.1+281301ea81e6", // Common (Legacy Fabric API)
69
70
"keybindings-api-v1-10809" to "1.1.1+1.8.9+2c3f108c81e6", // 1.8.9
70
71
"keybindings-api-v1-11202" to "1.1.1+1.12.2+2c3f108c81e6", // 1.12.2
@@ -87,6 +88,7 @@ private val fabricApiModuleVersions = mapOf(
87
88
"key-binding-api-v1-12109" to "1.1.0+4ec8267494", // 1.21.9
88
89
"key-binding-api-v1-12110" to "1.1.1+b3ba9c4868", // 1.21.10
89
90
"key-binding-api-v1-12111" to "1.1.7+4fc5413f53", // 1.21.11
91
+
"key-mapping-api-v1-260100" to "2.0.0+574290ba7d", // 26.1
90
92
"rendering-api-v1-common" to "1.0.0+7c545fdb81e6", // Common (Legacy Fabric API)
91
93
"rendering-api-v1-10809" to "1.0.0+1.8.9+2c3f108c81e6", // 1.8.9
92
94
"rendering-api-v1-11202" to "1.0.0+1.8.9+2c3f108c81e6", // 1.12.2
@@ -109,6 +111,7 @@ private val fabricApiModuleVersions = mapOf(
109
111
"rendering-v1-12109" to "15.0.2+9bce411b94", // 1.21.9
110
112
"rendering-v1-12110" to "16.0.1+328a75ba68", // 1.21.10
111
113
"rendering-v1-12111" to "16.2.5+1fb1cde953", // 1.21.11
114
+
"rendering-v1-260100" to "18.0.0+a9f246707d", // 26.1
112
115
"screen-api-v1-11605" to "1.0.1+3cc0f0907d", // 1.16.5
113
116
"screen-api-v1-11701" to "1.0.5+cf39a74318", // 1.17.1
114
117
"screen-api-v1-11802" to "1.0.11+d882b91560", // 1.18.2
@@ -128,6 +131,7 @@ private val fabricApiModuleVersions = mapOf(
128
131
"screen-api-v1-12109" to "3.0.2+86b3ae5794", // 1.21.9
129
132
"screen-api-v1-12110" to "3.1.0+9c82a79868", // 1.21.10
130
133
"screen-api-v1-12111" to "3.1.7+4ebb5c0853", // 1.21.11
134
+
"screen-api-v1-260100" to "4.0.0+574290ba7d", // 26.1
131
135
"command-api-v1-11605" to "1.1.3+3cc0f0907d", // 1.16.5
132
136
"command-api-v1-11701" to "1.1.4+cf39a74318", // 1.17.1
133
137
"command-api-v1-11802" to "1.1.10+d7c144a860", // 1.18.2
@@ -147,6 +151,7 @@ private val fabricApiModuleVersions = mapOf(
147
151
"command-api-v2-12109" to "2.3.5+33df5e6e94", // 1.21.9
148
152
"command-api-v2-12110" to "2.3.7+328a75ba68", // 1.21.10
149
153
"command-api-v2-12111" to "2.4.6+4ebb5c0853", // 1.21.11
154
+
"command-api-v2-260100" to "3.0.0+574290ba7d", // 26.1
150
155
"transitive-access-wideners-v1-11802" to "1.1.0+e747827960", // 1.18.2
151
156
"transitive-access-wideners-v1-11902" to "1.3.3+08b73de490", // 1.19.2
152
157
"transitive-access-wideners-v1-11904" to "3.3.0+1b5f819af4", // 1.19.4
@@ -164,6 +169,7 @@ private val fabricApiModuleVersions = mapOf(
164
169
"transitive-access-wideners-v1-12109" to "6.5.2+5d9dbead94", // 1.21.9
165
170
"transitive-access-wideners-v1-12110" to "6.5.3+41eb434368", // 1.21.10
166
171
"transitive-access-wideners-v1-12111" to "7.0.7+1fb1cde953", // 1.21.11
172
+
"transitive-access-wideners-v1-260100" to "8.0.1+a208210e7d", // 26.1
167
173
)
168
174
169
175
/**
@@ -172,7 +178,7 @@ private val fabricApiModuleVersions = mapOf(
172
178
* @param version The version of Minecraft. If null, the method is running inside the `:dependencies:legacy` module.
173
179
* @param loader The mod loader being used.
174
180
*/
175
-
fun Project.provideIncludedDependencies(version:Triple<Int, Int, Int>?, loader:String?): List<OCDependency> { // Either a String or ExternalModuleDependency
181
+
fun Project.provideIncludedDependencies(version:Triple<Int, Int, Int>?, loader:String?, shenanigans:String? = version?.toMCVer()): List<OCDependency> { // Either a String or ExternalModuleDependency
176
182
project.logger.lifecycle("===> Adding dependencies for Minecraft ${version?.toMCVer()} & $loader")
177
183
178
184
val libs = rootProject
@@ -201,17 +207,21 @@ fun Project.provideIncludedDependencies(version: Triple<Int, Int, Int>?, loader:
@@ -253,7 +263,7 @@ fun Project.provideIncludedDependencies(version: Triple<Int, Int, Int>?, loader:
253
263
fun Project.provideFabricApiDependency(version:Triple<Int, Int, Int>): List<OCDependency> {
254
264
val deps = mutableListOf<OCDependency>()
255
265
256
-
if (version.second <=12) {
266
+
if (version.first ==1&& version.second <=12) {
257
267
// Legacy Fabric
258
268
for (module in legacyFabricApiModules) {
259
269
val commonVersionValue = fabricApiModuleVersions["$module-common"] ?: error("No version found for $module-common")
@@ -265,14 +275,19 @@ fun Project.provideFabricApiDependency(version: Triple<Int, Int, Int>): List<OCD
265
275
// Modern Fabric
266
276
val finalList = mutableListOf<String>()
267
277
finalList.addAll(fabricApiModules)
268
-
if (version.second >=18) {
278
+
if (version.first >=2|| version.second >=18) {
269
279
finalList.add("transitive-access-wideners-v1")
270
280
}
271
-
if (version.second >=19) {
281
+
if (version.first >=2|| version.second >=19) {
272
282
finalList.add("command-api-v2")
273
283
} else {
274
284
finalList.add("command-api-v1")
275
285
}
286
+
if (version.first >=2) {
287
+
finalList.add("key-mapping-api-v1")
288
+
} else {
289
+
finalList.add("key-binding-api-v1")
290
+
}
276
291
for (module in finalList) {
277
292
val mcVersionValue = fabricApiModuleVersions["$module-${version.toPreprocessorNumber()}"] ?: error("No version found for $module-${version.toMCVer()}")
0 commit comments