1818
1919java. toolchain. languageVersion = JavaLanguageVersion . of(21 )
2020
21+ jarJar. enabled = true
22+
2123neoForge {
2224 // Specify the version of NeoForge to use.
2325 version = project. neo_version
@@ -87,13 +89,17 @@ neoForge {
8789 // but multi mod projects should define one per mod
8890 " ${ mod_id} " {
8991 sourceSet(sourceSets. main)
92+ sourceSet(project(" :common" ). sourceSets. main)
9093 }
9194 }
9295}
9396
9497// Include resources generated by data generators.
9598sourceSets. main. resources { srcDir ' src/generated/resources' }
9699
100+ compileJava {
101+ options. compilerArgs + = " -g"
102+ }
97103
98104dependencies {
99105 // Example mod dependency with JEI
@@ -119,30 +125,60 @@ dependencies {
119125
120126 // implementation "net.neoforged:neoforge:${neo_version}"
121127
122- implementation (jarJar(" net.kyori:adventure-api:4.17.0" )) {
128+ /* compileOnly (jarJar("net.kyori:adventure-api:4.17.0")) {
123129 exclude(module: "adventure-bom")
124130 exclude(module: "annotations")
125131 }
126- implementation (jarJar(" net.kyori:adventure-text-serializer-gson:4.17.0" )) {
132+ compileOnly (jarJar("net.kyori:adventure-text-serializer-gson:4.17.0")) {
127133 exclude(module: "adventure-bom")
128134 exclude(module: "adventure-api")
129135 exclude(module: "annotations")
130136 exclude(module: "auto-service-annotations")
131137 exclude(module: "gson")
132- }
133-
134- implementation(jarJar(" net.kyori:adventure-platform-neoforge:6.0.0" ))
138+ } */
135139
136- implementation(jarJar(project(path : " :common" , configuration : " shadow" )))
137-
138-
139-
140- // additionalRuntimeClasspath("com.cssbham:common:.*")
141- additionalRuntimeClasspath(" net.kyori:adventure-api:4.17.0" )
142- additionalRuntimeClasspath(" net.kyori:adventure-text-serializer-gson:4.17.0" )
140+ jarJar(implementation(group : " net.kyori" , name : " adventure-platform-neoforge" , version : " 6.0.0" ) {
141+ exclude(module : " annotations" )
142+ exclude(module : " auto-service-annotations" )
143+ exclude(module : " gson" )
144+ })
145+ jarJar(implementation (" net.dv8tion:JDA:5.0.2" ) {
146+ exclude(module : " opus-java" )
147+ exclude(module : " annotations" )
148+ exclude(module : " slf4j-api" )
149+ })
150+ jarJar(implementation (" club.minnced:discord-webhooks:0.8.4" ) {
151+ exclude(module : " slf4j-api" )
152+ })
153+ jarJar(implementation(" org.yaml:snakeyaml:2.2" ))
154+ jarJar(implementation(" com.neovisionaries:nv-websocket-client:2.14" ))
155+ jarJar(implementation(" com.squareup.okhttp3:okhttp:4.12.0" ))
156+ jarJar(implementation(" org.apache.commons:commons-collections4:4.4" ))
157+ jarJar(implementation(" org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.10" ))
158+ jarJar(implementation(" org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.10" ))
159+ jarJar(implementation(" org.jetbrains.kotlin:kotlin-stdlib-common:1.9.10" ))
160+ jarJar(implementation(" org.jetbrains.kotlin:kotlin-stdlib:1.9.10" ))
161+ jarJar(implementation(" com.squareup.okio:okio:3.6.0" ))
162+ jarJar(implementation(" net.sf.trove4j:core:3.1.0" ))
163+ jarJar(implementation(" com.fasterxml.jackson.core:jackson-core:2.17.2" ))
164+ jarJar(implementation(" com.fasterxml.jackson:jackson-bom:2.17.2" ))
165+ jarJar(implementation(" com.fasterxml.jackson.core:jackson-annotations:2.17.2" ))
166+ jarJar(implementation(" com.fasterxml.jackson.core:jackson-databind:2.17.2" ))
167+ jarJar(implementation(" org.json:json:20230618" ))
168+
169+ shadow(compileOnly(project(path : " :common" ))) {
170+ transitive(false )
171+ }
172+ // additionalRuntimeClasspath("org.yaml:snakeyaml:2.2")
173+ // additionalRuntimeClasspath("net.dv8tion:JDA:5.0.2")
174+ // additionalRuntimeClasspath("club.minnced:discord-webhooks:0.8.4")
175+ // additionalRuntimeClasspath("com.cssbham:common:1.0.0")
176+ // additionalRuntimeClasspath("net.kyori:adventure-api:4.17.0")
177+ // additionalRuntimeClasspath("net.kyori:adventure-platform-neoforge:6.0.0")
178+ // additionalRuntimeClasspath("net.kyori:adventure-text-serializer-gson:4.17.0")
143179}
144180
145- tasks. shadowJar. enabled = false
181+ // tasks.shadowJar.enabled = false
146182
147183// This block of code expands all declared replace properties in the specified resource targets.
148184// A missing property will result in an error. Properties are expanded using ${} Groovy notation.
@@ -179,3 +215,52 @@ idea {
179215 downloadJavadoc = true
180216 }
181217}
218+ /*
219+ tasks.shadowJar {
220+ configurations = [project.configurations.shadow]
221+
222+ dependencies {
223+ exclude(dependency("net.kyori:adventure-platform-neoforge:6.0.0"))
224+ }
225+
226+ doLast {
227+ copy {
228+ from("build/generated/jarjar/META-INF/jarjar")
229+ into("META-INF/jarjar")
230+ }
231+ }
232+
233+ // exclude("net/**")
234+ // exclude("META-INF/services/*")
235+ // minimize()
236+
237+ archiveFileName = "cssminecraft-neoforge-${project.version}.jar"
238+ }
239+
240+ */
241+
242+ tasks. shadowJar. enabled = false
243+ /*
244+ tasks.register("shadeCommon") {
245+ copy {
246+ from("../common/build/classes/main/com/cssbham/cssminecraft/common")
247+ into("build/classes/")
248+ }
249+ } */
250+
251+ tasks. jar {
252+ from(" ../common/build/classes/java/main/com/cssbham/cssminecraft/common" ) {
253+ into(" com/cssbham/cssminecraft/common" )
254+ }
255+ }
256+ /*
257+ tasks.register("copyJarJar") {
258+ copy {
259+ from ("build/generated/jarjar/META-INF/jarjar")
260+ into("META-INF/jarjar")
261+ }
262+ }
263+
264+ tasks.copyJarJar.dependsOn(jarJar)
265+ */
266+
0 commit comments