@@ -67,44 +67,16 @@ tasks.named("compileKotlin") {
6767 dependsOn(" downloadOdin" )
6868}
6969
70+ val devenvMod: Configuration by configurations.creating {
71+ isTransitive = false
72+ isVisible = false
73+ }
74+
7075// Toolchains:
7176java {
7277 toolchain.languageVersion.set(JavaLanguageVersion .of(8 ))
7378}
7479
75- // Minecraft configuration:
76- loom {
77- log4jConfigs.from(file(" log4j2.xml" ))
78- launchConfigs {
79- " client" {
80- property(" mixin.debug" , " true" )
81- arg(" --tweakClass" , " org.spongepowered.asm.launch.MixinTweaker" )
82- }
83- }
84- runConfigs {
85- " client" {
86- if (SystemUtils .IS_OS_MAC_OSX ) {
87- // This argument causes a crash on macOS
88- vmArgs.remove(" -XstartOnFirstThread" )
89- }
90- }
91- remove(getByName(" server" ))
92- }
93- forge {
94- pack200Provider.set(dev.architectury.pack200.java.Pack200Adapter ())
95- // If you don't want mixins, remove this lines
96- mixinConfig(" mixins.$modid .json" )
97- if (transformerFile.exists()) {
98- println (" Installing access transformer" )
99- accessTransformer(transformerFile)
100- }
101- }
102- // If you don't want mixins, remove these lines
103- mixin {
104- defaultRefmapName.set(" mixins.$modid .refmap.json" )
105- }
106- }
107-
10880tasks.compileJava {
10981 dependsOn(tasks.processResources)
11082}
@@ -135,6 +107,7 @@ dependencies {
135107 forge(" net.minecraftforge:forge:1.8.9-11.15.1.2318-1.8.9" )
136108 implementation(" org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4" )
137109 implementation(files(" build/resources/Odin/${requiredOdin} " ))
110+ devenvMod(files(" build/resources/Odin/${requiredOdin} " ))
138111 implementation(" org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0" )
139112
140113 shadowImpl(" org.apache.logging.log4j:log4j-core:2.20.0" )
@@ -160,6 +133,41 @@ dependencies {
160133
161134}
162135
136+
137+ // Minecraft configuration:
138+ loom {
139+ log4jConfigs.from(file(" log4j2.xml" ))
140+ launchConfigs {
141+ " client" {
142+ property(" mixin.debug" , " true" )
143+ arg(" --tweakClass" , " org.spongepowered.asm.launch.MixinTweaker" )
144+ arg(" --mods" , devenvMod.resolve().joinToString(" ," ) { it.relativeTo(file(" run" )).path })
145+ }
146+ }
147+ runConfigs {
148+ " client" {
149+ if (SystemUtils .IS_OS_MAC_OSX ) {
150+ // This argument causes a crash on macOS
151+ vmArgs.remove(" -XstartOnFirstThread" )
152+ }
153+ }
154+ remove(getByName(" server" ))
155+ }
156+ forge {
157+ pack200Provider.set(dev.architectury.pack200.java.Pack200Adapter ())
158+ // If you don't want mixins, remove this lines
159+ mixinConfig(" mixins.$modid .json" )
160+ if (transformerFile.exists()) {
161+ println (" Installing access transformer" )
162+ accessTransformer(transformerFile)
163+ }
164+ }
165+ // If you don't want mixins, remove these lines
166+ mixin {
167+ defaultRefmapName.set(" mixins.$modid .refmap.json" )
168+ }
169+ }
170+
163171// Tasks:
164172tasks.withType(JavaCompile ::class ) {
165173 options.encoding = " UTF-8"
0 commit comments