11plugins {
2- id(" dev.architectury.loom" )
3- id(" architectury-plugin" )
2+ id(" net.neoforged.moddev.legacyforge" )
43 id(" com.gradleup.shadow" )
54}
65
@@ -11,9 +10,33 @@ val common: Project = requireNotNull(stonecutter.node.sibling("")?.project) {
1110 " No common project for $project "
1211}
1312
14- architectury {
15- platformSetupLoomIde()
16- forge()
13+ legacyForge.version = " $minecraftVersion -${common.mod.dep(" forge" )} "
14+
15+ fun loaderDep (dep : String ): Any {
16+ return common?.project?.mod?.dep(dep) ? : mod.dep(dep, " [UNSUPPORTED]" )
17+ }
18+
19+ legacyForge {
20+ parchment {
21+ minecraftVersion.set(loaderDep(" parchment_version" ) as String )
22+ mappingsVersion.set(loaderDep(" parchment_snapshot" ) as String )
23+ }
24+
25+ runs {
26+ create(" client" ) {
27+ client()
28+ }
29+
30+ create(" server" ) {
31+ server()
32+ }
33+ }
34+
35+ mods {
36+ create(" unitytranslate" ) {
37+ sourceSet(sourceSets.main.get())
38+ }
39+ }
1740}
1841
1942val commonBundle: Configuration by configurations.creating {
@@ -29,15 +52,20 @@ val shadowBundle: Configuration by configurations.creating {
2952configurations {
3053 compileClasspath.get().extendsFrom(commonBundle)
3154 runtimeClasspath.get().extendsFrom(commonBundle)
32- get(" developmentForge" ).extendsFrom(commonBundle)
55+ // get("developmentForge").extendsFrom(commonBundle)
56+ }
57+
58+ mixin {
59+ add(sourceSets.main.get(), " mixins.unitytranslate.refmap.json" )
60+ config(" unitytranslate.mixins.json" )
3361}
3462
3563repositories {
3664 maven(" https://maven.minecraftforge.net/" )
3765}
3866
3967dependencies {
40- " forge " ( " net.minecraftforge:forge: $minecraftVersion - ${common.mod.dep( " forge " )} " )
68+ annotationProcessor( " org.spongepowered:mixin:0.8.5:processor " )
4169
4270 modImplementation(" maven.modrinth:talk-balloons:${common.mod.dep(" talk_balloons" )} +${common.mod.dep(" talk_balloons_mc" )} -forge" )
4371 modImplementation(" me.shedaniel.cloth:cloth-config-forge:${common.mod.dep(" cloth_config" )} " )
@@ -51,23 +79,31 @@ dependencies {
5179 modOptional(" maven.modrinth:plasmo-voice" , " forge-${mod.commonDep(" plasmo_mc" , common.mod, minecraftVersion)} -${mod.commonDep(" plasmo" , common.mod)} " , common.mod.prop(" proximity_chat" ) == " plasmo" )
5280 modOptional(" maven.modrinth:simple-voice-chat" , " forge-$minecraftVersion -${mod.commonDep(" voicechat" , common.mod)} " , common.mod.prop(" proximity_chat" ) == " svc" )
5381
54- minecraftRuntimeLibraries( shadowBundle(" org.java-websocket:Java-WebSocket:${mod.commonDep(" java_websocket" , common.mod)} " )!! )
55- minecraftRuntimeLibraries( shadowBundle(" com.squareup.okhttp3:okhttp:${mod.commonDep(" okhttp" , common.mod)} " ) {
82+ add( " additionalRuntimeClasspath " , shadowBundle(" org.java-websocket:Java-WebSocket:${mod.commonDep(" java_websocket" , common.mod)} " )!! )
83+ add( " additionalRuntimeClasspath " , shadowBundle(" com.squareup.okhttp3:okhttp:${mod.commonDep(" okhttp" , common.mod)} " ) {
5684 exclude(" org.jetbrains" )
5785 exclude(" kotlin" )
5886 })
59- minecraftRuntimeLibraries( shadowBundle(" com.github.jnr:jnr-ffi:${mod.commonDep(" jnr" , common.mod)} " )!! )
87+ add( " additionalRuntimeClasspath " , shadowBundle(" com.github.jnr:jnr-ffi:${mod.commonDep(" jnr" , common.mod)} " )!! )
6088
6189 shadowBundle(" xyz.bluspring.unitytranslate:UnityTranslateLib:${mod.commonDep(" unitytranslatelib" , common.mod)} " )
6290 shadowBundle(" xyz.bluspring.unitytranslate:UnityTranslateLib-natives-windows-amd64:${mod.commonDep(" unitytranslatelib" , common.mod)} " )
6391 shadowBundle(" xyz.bluspring.unitytranslate:UnityTranslateLib-natives-linux-amd64:${mod.commonDep(" unitytranslatelib" , common.mod)} " )
6492}
6593
66- loom {
67- runConfigs.all {
68- isIdeConfigGenerated = true
69- runDir = " ../../../run"
70- vmArgs(" -Dmixin.debug.export=true" , " -XX:+AllowEnhancedClassRedefinition" )
94+ // loom {
95+ // runConfigs.all {
96+ // isIdeConfigGenerated = true
97+ // runDir = "../../../run"
98+ // vmArgs("-Dmixin.debug.export=true", "-XX:+AllowEnhancedClassRedefinition")
99+ // }
100+ // }
101+
102+ tasks.jar {
103+ manifest {
104+ attributes(mapOf (
105+ " MixinConfigs" to " unitytranslate.mixins.json"
106+ ))
71107 }
72108}
73109
@@ -77,6 +113,10 @@ tasks.shadowJar {
77113 exclude(" fabric.mod.json" , " architectury.common.json" )
78114}
79115
116+ obfuscation {
117+ reobfuscate(tasks.shadowJar, sourceSets.main.get())
118+ }
119+
80120tasks.processResources {
81121 properties(listOf (" META-INF/neoforge.mods.toml" , " META-INF/mods.toml" ),
82122 " mod_id" to mod.id,
@@ -98,10 +138,10 @@ tasks.build {
98138 description = " Must run through 'chiseledBuild'"
99139}
100140
101- tasks.register<Copy >(" buildAndCollect" ) {
102- group = " versioned"
103- description = " Must run through 'chiseledBuild'"
104- from(tasks.remapJar .get().archiveFile, tasks.remapSourcesJar .get().archiveFile)
105- into(rootProject.layout.buildDirectory.file(" libs/${mod.version} /$loader " ))
106- dependsOn(" build" )
107- }
141+ // tasks.register<Copy>("buildAndCollect") {
142+ // group = "versioned"
143+ // description = "Must run through 'chiseledBuild'"
144+ // from(tasks.reobfJar .get().archiveFile, tasks.sourcesJar .get().archiveFile)
145+ // into(rootProject.layout.buildDirectory.file("libs/${mod.version}/$loader"))
146+ // dependsOn("build")
147+ // }
0 commit comments