@@ -2,7 +2,7 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget
22import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
33
44plugins {
5- id(" net.fabricmc.fabric- loom-remap " ) version " 1.14-SNAPSHOT "
5+ id(" dev.kikugie. loom-back-compat " )
66 id(" org.jetbrains.kotlin.jvm" ) version " 2.3.0"
77 id(" dev.deftu.gradle.bloom" ) version " 0.2.0"
88}
@@ -17,10 +17,31 @@ base {
1717}
1818
1919repositories {
20+ mavenCentral()
21+ gradlePluginPortal()
22+ google()
23+
2024 maven(" https://maven.parchmentmc.org" )
2125 maven(" https://repo.polyfrost.org/releases" )
2226 maven(" https://repo.polyfrost.org/snapshots" )
2327 maven(" https://maven.gegy.dev/releases" )
28+
29+ maven(" https://maven.logix.dev/snapshots" )
30+ maven(" https://nexus.prsm.wtf/repository/maven-public/maven-repo/releases/" )
31+ maven(" https://repo.hypixel.net/repository/Hypixel/" )
32+ maven(" https://maven.deftu.dev/releases" )
33+
34+ maven(" https://maven.fabricmc.net/releases" )
35+ maven(" https://jitpack.io" ) {
36+ content { includeGroupAndSubgroups(" com.github" ) }
37+ }
38+ maven(" https://maven.bawnorton.com/releases" ) {
39+ content { includeGroup(" com.github.bawnorton.mixinsquared" ) }
40+ }
41+ maven(" https://maven.azureaaron.net/releases" ) {
42+ content { includeGroup(" net.azureaaron" ) }
43+ }
44+ maven(" https://redirector.kotlinlang.org/maven/compose-dev" )
2445}
2546
2647loom {
@@ -34,26 +55,34 @@ loom {
3455
3556dependencies {
3657 minecraft(" com.mojang:minecraft:${property(" minecraft_version" )} " )
37- @Suppress(" UnstableApiUsage" )
38- mappings(loom.layered {
39- officialMojangMappings()
40- optionalProp(" ${property(" parchment_version" )} " ) {
41- parchment(" org.parchmentmc.data:parchment-${property(" minecraft_version" )} :$it @zip" )
42- }
43- optionalProp(" ${property(" yalmm_version" )} " ) {
44- mappings(" dev.lambdaurora:yalmm-mojbackward:${property(" minecraft_version" )} +build.$it " )
58+
59+ val hasOfficialMappings = findProperty(" has_official_mappings" )?.toString()?.toBoolean() ? : true
60+ if (hasOfficialMappings) {
61+ @Suppress(" UnstableApiUsage" )
62+ mappings(loom.layered {
63+ officialMojangMappings()
64+ optionalProp(" ${property(" parchment_version" )} " ) {
65+ parchment(" org.parchmentmc.data:parchment-${property(" minecraft_version" )} :$it @zip" )
66+ }
67+ optionalProp(" ${property(" yalmm_version" )} " ) {
68+ mappings(" dev.lambdaurora:yalmm-mojbackward:${property(" minecraft_version" )} +build.$it " )
69+ }
70+ })
71+ } else {
72+ findProperty(" mappings_version" )?.toString()?.takeUnless { it.isBlank() }?.let {
73+ mappings(it)
4574 }
46- })
75+ }
4776 modImplementation(" net.fabricmc:fabric-loader:${property(" loader_version" )} " )
48- modImplementation(" org.polyfrost.oneconfig:${property(" minecraft_version" )} -fabric:1.0.0-alpha.181 " )
49- modImplementation (" org.polyfrost.oneconfig:commands:1.0.0-alpha.181 " )
50- modImplementation (" org.polyfrost.oneconfig:config:1.0.0-alpha.181 " )
51- modImplementation (" org.polyfrost.oneconfig:config-impl:1.0.0-alpha.181 " )
52- modImplementation (" org.polyfrost.oneconfig:events:1.0.0-alpha.181 " )
53- modImplementation (" org.polyfrost.oneconfig:internal:1.0.0-alpha.181 " )
54- modImplementation (" org.polyfrost.oneconfig:ui:1.0.0-alpha.181 " )
55- modImplementation (" org.polyfrost.oneconfig:utils:1.0.0-alpha.181 " )
56- modImplementation (" org.polyfrost.oneconfig:hud:1.0.0-alpha.181 " )
77+ modImplementation(" org.polyfrost.oneconfig:${property(" minecraft_version" )} -fabric:1.0.0-alpha.192 " )
78+ implementation (" org.polyfrost.oneconfig:commands:1.0.0-alpha.192 " )
79+ implementation (" org.polyfrost.oneconfig:config:1.0.0-alpha.192 " )
80+ implementation (" org.polyfrost.oneconfig:config-impl:1.0.0-alpha.192 " )
81+ implementation (" org.polyfrost.oneconfig:events:1.0.0-alpha.192 " )
82+ implementation (" org.polyfrost.oneconfig:internal:1.0.0-alpha.192 " )
83+ implementation (" org.polyfrost.oneconfig:ui:1.0.0-alpha.192 " )
84+ implementation (" org.polyfrost.oneconfig:utils:1.0.0-alpha.192 " )
85+ implementation (" org.polyfrost.oneconfig:hud:1.0.0-alpha.192 " )
5786}
5887
5988bloom {
@@ -78,18 +107,31 @@ tasks.processResources {
78107 }
79108}
80109
110+ val javaVersionStr = findProperty(" java_version" )?.toString() ? : " 21"
111+ val javaVersionInt = javaVersionStr.toInt()
112+
113+ val kotlinJvmTarget = when (javaVersionInt) {
114+ 21 -> JvmTarget .JVM_21
115+ 22 -> JvmTarget .JVM_22
116+ 23 -> JvmTarget .JVM_23
117+ 24 -> JvmTarget .JVM_24
118+ 25 -> JvmTarget .JVM_25
119+ else -> JvmTarget .JVM_21
120+ }
121+
81122tasks.withType<JavaCompile >().configureEach {
82- options.release.set(21 )
123+ options.release.set(javaVersionInt )
83124}
84125
85126tasks.withType<KotlinCompile >().configureEach {
86- compilerOptions.jvmTarget.set(JvmTarget . JVM_21 )
127+ compilerOptions.jvmTarget.set(kotlinJvmTarget )
87128}
88129
89130java {
90131 withSourcesJar()
91- sourceCompatibility = JavaVersion .VERSION_21
92- targetCompatibility = JavaVersion .VERSION_21
132+ toolchain {
133+ languageVersion.set(JavaLanguageVersion .of(javaVersionInt))
134+ }
93135}
94136
95137tasks.jar {
0 commit comments