11plugins {
2- id ' fabric-loom ' version ' 1.10-SNAPSHOT '
2+ id ' net.neoforged.moddev ' version ' 2.0.96 '
33 id ' maven-publish'
44}
55
1111}
1212
1313repositories {
14- mavenLocal()
14+ // TODO: generally bad practice to have it enabled by default
15+ // mavenLocal()
1516 maven { url = " https://maven.is-immensely.gay/releases" } // Revelationary, Fractal, AEA, Arrowhead, Dimensional Reverb...
1617 maven { url = " https://maven.shedaniel.me/" } // Cloth Config, REI
1718 maven { url = " https://maven.terraformersmc.com/" } // Modmenu, EMI
@@ -33,91 +34,136 @@ repositories {
3334 mavenCentral()
3435}
3536
36- fabricApi {
37- configureDataGeneration {
38- client = true
39- modId = " spectrum-datagen"
40- createSourceSet = true
41- }
42- }
37+ neoForge {
38+ version = project. neoforge_version
4339
44- dependencies {
45- // jetbrains annotations
46- implementation(" org.jetbrains:annotations:26.0.2" )
47-
48- // graph api and its dependencies
49- implementation include(" org.jgrapht:jgrapht-core:1.5.2" )
50- implementation include(" org.apfloat:apfloat:1.14.0" )
51- implementation include(" org.jheaps:jheaps:0.14" )
52-
53- // Some other dependency is adding annotations, and it throws an error without this
54- compileOnly(" com.demonwav.mcdev:annotations:1.0" )
55-
56- // minecraft, fabric & api
57- minecraft(" com.mojang:minecraft:${ project.minecraft_version} " )
58- mappings loom. layered() {
59- officialMojangMappings()
60- parchment(" org.parchmentmc.data:parchment-${ project.parchment_mappings} @zip" )
61- }
62- modImplementation(" net.fabricmc:fabric-loader:${ project.loader_version} " )
63- modImplementation(" net.fabricmc.fabric-api:fabric-api:${ project.fabric_api_version} " )
64-
65- // ours
66- modImplementation include(" maven.modrinth:exclusions-lib:${ project.exclusionslib_version} " )
67- modImplementation(" de.dafuqs:revelationary:${ project.revelationary_version} " )
68- modImplementation include(" de.dafuqs:additionalentityattributes:${ project.additional_entity_attributes_version} " )
69- modImplementation include(" de.dafuqs:arrowhead:${ project.arrowhead_version} " )
70- modImplementation include(" de.dafuqs:reverb:${ project.dimensional_reverb_version} " )
71- modImplementation include(" de.dafuqs:fractal:${ project.fractal_version} " )
72-
73- // external and compat
74- modApi(" me.shedaniel.cloth:cloth-config-fabric:${ project.cloth_config_version} " ) { exclude(group : " net.fabricmc.fabric-api" ) }
75- modApi(" dev.architectury:architectury-fabric:${ project.architectury_version} " ) { exclude(group : " net.fabricmc.fabric-api" ) }
76- modApi(" com.terraformersmc:modmenu:${ project.modmenu_version} " )
77- modImplementation(" eu.pb4:common-protection-api:${ project.cpa_version} " )
78- modImplementation(" dev.emi:trinkets:${ project.trinkets_version} " ) // https://github.com/emilyploszaj/trinkets
79- modCompileOnly(" me.shedaniel:RoughlyEnoughItems-fabric:${ project.rei_version} " )
80- // https://github.com/shedaniel/RoughlyEnoughItems
81- modCompileOnly(" dev.emi:emi-fabric:${ emi_version} " ) // https://github.com/emilyploszaj/emi
82- // https://github.com/klikli-dev/modonomicon
83- modImplementation(" com.klikli_dev:modonomicon-${ project.minecraft_version} -fabric:${ project.modonomicon_version} " ) {
84- exclude(group : " com.klikli_dev" )
85- exclude(group : " mezz.jei" )
40+ parchment {
41+ minecraftVersion = project. parchment_minecraft_version
42+ mappingsVersion = project. parchment_mappings_version
8643 }
8744
88- switch (recipe_viewer. toLowerCase(Locale . ROOT )) {
89- case " rei" : modLocalRuntime(" me.shedaniel:RoughlyEnoughItems-fabric:$rei_version " ); break
90- case " emi" : modLocalRuntime(" dev.emi:emi-fabric:${ emi_version} " ); break
91- case " disabled" : break
92- default : println (" Unknown recipe viewer specified: $recipe_viewer . Must be EMI, REI or disabled." )
45+ // Default run configurations.
46+ // These can be tweaked, removed, or duplicated as needed.
47+ runs {
48+ client {
49+ client()
50+ }
51+
52+ server {
53+ server()
54+ programArgument ' --nogui'
55+ }
56+
57+ // data {
58+ // data()
59+ //
60+ // // example of overriding the workingDirectory set in configureEach above, uncomment if you want to use it
61+ // // gameDirectory = project.file('run-data')
62+ //
63+ // // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
64+ // programArguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
65+ // }
66+
67+ // applies to all the run configs above
68+ configureEach {
69+ // Recommended logging data for a userdev environment
70+ // The markers can be added/remove as needed separated by commas.
71+ // "SCAN": For mods scan.
72+ // "REGISTRIES": For firing of registry events.
73+ // "REGISTRYDUMP": For getting the contents of all registries.
74+ systemProperty ' forge.logging.markers' , ' REGISTRIES'
75+
76+ // Recommended logging level for the console
77+ // You can set various levels here.
78+ // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
79+ logLevel = org.slf4j.event.Level . DEBUG
80+ }
9381 }
9482
95- // https://github.com/OnyxStudios/Cardinal-Components-API/wiki/
96- modImplementation include(" org.ladysnake.cardinal-components-api:cardinal-components-base:${ project.cca_version} " )
97- modImplementation include(" org.ladysnake.cardinal-components-api:cardinal-components-entity:${ project.cca_version} " )
98- modImplementation include(" org.ladysnake.cardinal-components-api:cardinal-components-item:${ project.cca_version} " )
99- modImplementation include(" org.ladysnake.cardinal-components-api:cardinal-components-level:${ project.cca_version} " )
100-
101- // Connect to local dev servers
102- // modLocalRuntime("maven.modrinth:auth-me:${project.auth_me_version}")
103-
104- // Mod Compat
105- modCompileOnly(" maven.modrinth:colorful-hearts:${ project.colorful_hearts_version} " ) { transitive = false }
106- modCompileOnly(" maven.modrinth:sodium:${ project.sodium_version} " ) { transitive = false }
107- modCompileOnly(" com.unascribed:ears-api:${ project.ears_version} " )
108- modCompileOnly(" maven.modrinth:create-fabric:${ project.create_version} " ) { transitive = false }
109- modCompileOnly(" maven.modrinth:neepmeat:${ project.neepmeat_version} " ) { transitive = false }
110- modCompileOnly(" maven.modrinth:lodestonelib:${ project.lodestone_version} " ) { transitive = false }
111- modCompileOnly(" maven.modrinth:malum:${ project.malum_version} " ) { transitive = false }
112- modCompileOnly(" maven.modrinth:travelersbackpack:${ project.travelers_backpack_version} " )
113- modCompileOnly(" maven.modrinth:botania:${ project.botania_version} " )
114- modCompileOnly(" maven.modrinth:vanity:${ project.vanityslots_version} " )
115- modImplementation(" maven.modrinth:idwtialsimmoedm:${ project.idwtialsimmoedm_version} " )
116-
117- // Porting Lib
118- for (String module in port_lib_modules. split(" ," )) {
119- modCompileOnly(" io.github.fabricators_of_create.Porting-Lib:$module :${ project.port_lib_version} " ) { transitive = false }
83+ mods {
84+ spectrum {
85+ sourceSet sourceSets. main
86+ }
12087 }
88+ }
89+
90+ dependencies {
91+ // // jetbrains annotations
92+ // implementation("org.jetbrains:annotations:26.0.2")
93+ //
94+ // // graph api and its dependencies
95+ // implementation include("org.jgrapht:jgrapht-core:1.5.2")
96+ // implementation include("org.apfloat:apfloat:1.14.0")
97+ // implementation include("org.jheaps:jheaps:0.14")
98+ //
99+ // // Some other dependency is adding annotations, and it throws an error without this
100+ // compileOnly("com.demonwav.mcdev:annotations:1.0")
101+ //
102+ // // minecraft, fabric & api
103+ // minecraft("com.mojang:minecraft:${project.minecraft_version}")
104+ // mappings loom.layered() {
105+ // officialMojangMappings()
106+ // parchment("org.parchmentmc.data:parchment-${project.parchment_mappings}@zip")
107+ // }
108+ // modImplementation("net.fabricmc:fabric-loader:${project.loader_version}")
109+ // modImplementation("net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}")
110+ //
111+ // // ours
112+ // modImplementation include("maven.modrinth:exclusions-lib:${project.exclusionslib_version}")
113+ // modImplementation("de.dafuqs:revelationary:${project.revelationary_version}")
114+ // modImplementation include("de.dafuqs:additionalentityattributes:${project.additional_entity_attributes_version}")
115+ // modImplementation include("de.dafuqs:arrowhead:${project.arrowhead_version}")
116+ // modImplementation include("de.dafuqs:reverb:${project.dimensional_reverb_version}")
117+ // modImplementation include("de.dafuqs:fractal:${project.fractal_version}")
118+ //
119+ // // external and compat
120+ // modApi("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version}") { exclude(group: "net.fabricmc.fabric-api") }
121+ // modApi("dev.architectury:architectury-fabric:${project.architectury_version}") { exclude(group: "net.fabricmc.fabric-api") }
122+ // modApi("com.terraformersmc:modmenu:${project.modmenu_version}")
123+ // modImplementation("eu.pb4:common-protection-api:${project.cpa_version}")
124+ // modImplementation("dev.emi:trinkets:${project.trinkets_version}") // https://github.com/emilyploszaj/trinkets
125+ // modCompileOnly("me.shedaniel:RoughlyEnoughItems-fabric:${project.rei_version}")
126+ // // https://github.com/shedaniel/RoughlyEnoughItems
127+ // modCompileOnly("dev.emi:emi-fabric:${emi_version}") // https://github.com/emilyploszaj/emi
128+ // // https://github.com/klikli-dev/modonomicon
129+ // modImplementation("com.klikli_dev:modonomicon-${project.minecraft_version}-fabric:${project.modonomicon_version}") {
130+ // exclude(group: "com.klikli_dev")
131+ // exclude(group: "mezz.jei")
132+ // }
133+ //
134+ // switch (recipe_viewer.toLowerCase(Locale.ROOT)) {
135+ // case "rei": modLocalRuntime("me.shedaniel:RoughlyEnoughItems-fabric:$rei_version"); break
136+ // case "emi": modLocalRuntime("dev.emi:emi-fabric:${emi_version}"); break
137+ // case "disabled": break
138+ // default: println("Unknown recipe viewer specified: $recipe_viewer. Must be EMI, REI or disabled.")
139+ // }
140+ //
141+ // // https://github.com/OnyxStudios/Cardinal-Components-API/wiki/
142+ // modImplementation include("org.ladysnake.cardinal-components-api:cardinal-components-base:${project.cca_version}")
143+ // modImplementation include("org.ladysnake.cardinal-components-api:cardinal-components-entity:${project.cca_version}")
144+ // modImplementation include("org.ladysnake.cardinal-components-api:cardinal-components-item:${project.cca_version}")
145+ // modImplementation include("org.ladysnake.cardinal-components-api:cardinal-components-level:${project.cca_version}")
146+ //
147+ // // Connect to local dev servers
148+ // // modLocalRuntime("maven.modrinth:auth-me:${project.auth_me_version}")
149+ //
150+ // // Mod Compat
151+ // modCompileOnly("maven.modrinth:colorful-hearts:${project.colorful_hearts_version}") { transitive = false }
152+ // modCompileOnly("maven.modrinth:sodium:${project.sodium_version}") { transitive = false }
153+ // modCompileOnly("com.unascribed:ears-api:${project.ears_version}")
154+ // modCompileOnly("maven.modrinth:create-fabric:${project.create_version}") { transitive = false }
155+ // modCompileOnly("maven.modrinth:neepmeat:${project.neepmeat_version}") { transitive = false }
156+ // modCompileOnly("maven.modrinth:lodestonelib:${project.lodestone_version}") { transitive = false }
157+ // modCompileOnly("maven.modrinth:malum:${project.malum_version}") { transitive = false }
158+ // modCompileOnly("maven.modrinth:travelersbackpack:${project.travelers_backpack_version}")
159+ // modCompileOnly("maven.modrinth:botania:${project.botania_version}")
160+ // modCompileOnly("maven.modrinth:vanity:${project.vanityslots_version}")
161+ // modImplementation("maven.modrinth:idwtialsimmoedm:${project.idwtialsimmoedm_version}")
162+ //
163+ // //Porting Lib
164+ // for (String module in port_lib_modules.split(",")) {
165+ // modCompileOnly("io.github.fabricators_of_create.Porting-Lib:$module:${project.port_lib_version}") { transitive = false }
166+ // }
121167
122168 // Datagen dependencies
123169 // TODO - Noaaan April 7th 2025: None of these are for 1.21.1 yet, lol
@@ -128,27 +174,34 @@ dependencies {
128174 // modDatagenRuntimeOnly("maven.modrinth:create-fabric:${project.create_version}")
129175}
130176
131- loom {
132- accessWidenerPath = file(" src/main/resources/spectrum.accesswidener" )
133- }
134-
135- processResources {
136- inputs. property " version" , project. version
137- inputs. property " minecraft_version" , project. minecraft_version
138- inputs. property " loader_version" , project. loader_version
139- filteringCharset = " UTF-8"
177+ // loom {
178+ // accessWidenerPath = file("src/main/resources/spectrum.accesswidener")
179+ // }
140180
141- filesMatching(" fabric.mod.json" ) {
142- expand " version" : project. version,
143- " minecraft_version" : project. minecraft_version,
144- " loader_version" : project. loader_version
145- }
181+ // This block of code expands all declared replace properties in the specified resource targets.
182+ // A missing property will result in an error. Properties are expanded using ${} Groovy notation.
183+ var generateModMetadata = tasks. register(" generateModMetadata" , ProcessResources ) {
184+ var replaceProperties = [
185+ version : version,
186+ minecraft_version : minecraft_version,
187+ neoforge_version_range : neoforge_version_range,
188+ ]
189+ inputs. properties replaceProperties
190+ expand replaceProperties
191+ from " src/main/templates"
192+ into " build/generated/sources/modMetadata"
146193}
194+ // Include the output of "generateModMetadata" as an input directory for the build
195+ // this works with both building through Gradle and the IDE.
196+ sourceSets. main. resources. srcDir generateModMetadata
197+ // To avoid having to run "generateModMetadata" manually, make it run on every project reload
198+ neoForge. ideSyncTask generateModMetadata
147199
148200tasks. withType(JavaCompile ). configureEach {
149201 it. options. release = 21
150202}
151203
204+ // TODO: bad practice, generally indicates an issue with the build
152205tasks. withType(Jar ). configureEach {
153206 duplicatesStrategy = DuplicatesStrategy . WARN
154207}
0 commit comments