1+ plugins {
2+ id(" dev.architectury.loom" )
3+ id(" architectury-plugin" )
4+ id(" com.gradleup.shadow" )
5+ }
6+
7+ val loader = prop(" loom.platform" )!!
8+ val minecraftVersion = stonecutter.current.version
9+
10+ val common: Project = requireNotNull(stonecutter.node.sibling(" " )?.project) {
11+ " No common project for $project "
12+ }
13+
14+ architectury {
15+ platformSetupLoomIde()
16+ neoForge()
17+ }
18+
19+ val commonBundle: Configuration by configurations.creating {
20+ isCanBeConsumed = false
21+ isCanBeResolved = true
22+ }
23+
24+ val shadowBundle: Configuration by configurations.creating {
25+ isCanBeConsumed = false
26+ isCanBeResolved = true
27+ }
28+
29+ configurations {
30+ compileClasspath.get().extendsFrom(commonBundle)
31+ runtimeClasspath.get().extendsFrom(commonBundle)
32+ get(" developmentNeoForge" ).extendsFrom(commonBundle)
33+ }
34+
35+ repositories {
36+ maven(" https://maven.neoforged.net/releases/" )
37+ }
38+
39+ dependencies {
40+ " neoForge" (" net.neoforged:neoforge:${common.mod.dep(" neoforge" )} " )
41+
42+ modImplementation(" maven.modrinth:talk-balloons:${common.mod.dep(" talk_balloons" )} +${common.mod.dep(" talk_balloons_mc" )} -neoforge" )
43+ modImplementation(" me.shedaniel.cloth:cloth-config-neoforge:${common.mod.dep(" cloth_config" )} " )
44+
45+ commonBundle(project(common.path, " namedElements" )) { isTransitive = false }
46+ shadowBundle(project(common.path, " transformProductionNeoForge" )) { isTransitive = false }
47+
48+ modImplementation(" dev.nyon:KotlinLangForge:${common.mod.dep(" kotlinlangforge" )} -${common.mod.dep(" kotlinlangforge_loader" )} +neoforge" )
49+ modImplementation(" xyz.bluspring.modernnetworking:modernnetworking-neoforge:${common.mod.dep(" modernnetworking" )} +${common.mod.dep(" modernnetworking_mc" )} " )!!
50+ }
51+
52+ loom {
53+ runConfigs.all {
54+ isIdeConfigGenerated = true
55+ runDir = " ../../../run"
56+ vmArgs(" -Dmixin.debug.export=true" , " -XX:+AllowEnhancedClassRedefinition" )
57+ }
58+ }
59+
60+ tasks.shadowJar {
61+ configurations = listOf (shadowBundle)
62+ archiveClassifier = " dev-shadow"
63+ exclude(" fabric.mod.json" , " architectury.common.json" )
64+ }
65+
66+ tasks.processResources {
67+ properties(listOf (" META-INF/neoforge.mods.toml" , " META-INF/mods.toml" ),
68+ " mod_id" to mod.id,
69+ " mod_name" to mod.name,
70+ " mod_version" to mod.version,
71+ " mod_description" to mod.prop(" description" ),
72+ " mod_authors" to mod.prop(" authors" ),
73+ " minecraft_version_range" to common.mod.prop(" mc_dep_forgelike" ),
74+ " neoforge_version" to common.mod.dep(" neoforge" ),
75+ " cloth_config_version" to common.mod.dep(" cloth_config" ),
76+ " modernnetworking_version" to common.mod.dep(" modernnetworking" ),
77+ " kotlinlangforge_loader" to common.mod.dep(" kotlinlangforge_loader" ),
78+ " kotlinlangforge_version" to common.mod.dep(" kotlinlangforge" )
79+ )
80+ }
81+
82+ tasks.build {
83+ group = " versioned"
84+ description = " Must run through 'chiseledBuild'"
85+ }
86+
87+ tasks.register<Copy >(" buildAndCollect" ) {
88+ group = " versioned"
89+ description = " Must run through 'chiseledBuild'"
90+ from(tasks.remapJar.get().archiveFile, tasks.remapSourcesJar.get().archiveFile)
91+ into(rootProject.layout.buildDirectory.file(" libs/${mod.version} /$loader " ))
92+ dependsOn(" build" )
93+ }
0 commit comments