11plugins {
22 id ' java-library'
3- id ' eclipse'
4- id ' idea'
53 id ' maven-publish'
6- id ' net.neoforged.gradle.userdev' version ' 7.0.142'
4+ id ' net.neoforged.moddev' version ' 2.0.80'
5+ id ' idea'
76 id ' net.darkhax.curseforgegradle' version ' 1.1.15'
87 id " com.modrinth.minotaur" version " 2.+"
98}
109
10+ tasks. named(' wrapper' , Wrapper ). configure {
11+ distributionType = Wrapper.DistributionType . BIN
12+ }
13+
1114def env = System . getenv()
1215if (env. GITHUB_RUN_NUMBER ) {
13- mod_version = ' 1.20.4 -1.0.0' + " ." + " ${ env.GITHUB_RUN_NUMBER} "
16+ mod_version = ' 1.21.1 -1.0.0' + " ." + " ${ env.GITHUB_RUN_NUMBER} "
1417}
1518
1619version = mod_version
@@ -19,7 +22,7 @@ group = mod_group_id
1922repositories {
2023 mavenLocal()
2124 maven {
22- url = uri(" https://maven.pkg.github.com/refinedmods/refinedstorage " )
25+ url = uri(" https://maven.pkg.github.com/refinedmods/refinedstorage2 " )
2326 /* As of december 2021, GitHub packages requires authentication.
2427 The password below is a personal access token that has read access to the Refined Mods repos.
2528 It can be reused in other projects.
@@ -55,31 +58,77 @@ base {
5558 archivesName = mod_id + " -neoforge"
5659}
5760
58- java. toolchain. languageVersion = JavaLanguageVersion . of(17 )
61+ java. toolchain. languageVersion = JavaLanguageVersion . of(21 )
5962
60- runs {
61- configureEach {
62- systemProperty ' forge.logging.markers' , ' REGISTRIES'
63- systemProperty ' forge.logging.console.level' , ' debug'
63+ neoForge {
64+ // Specify the version of NeoForge to use.
65+ version = project. neo_version
6466
65- modSource project. sourceSets. main
67+ parchment {
68+ mappingsVersion = project. parchment_mappings_version
69+ minecraftVersion = project. parchment_minecraft_version
6670 }
6771
68- client {
69- systemProperty ' forge.enabledGameTestNamespaces' , project. mod_id
70- }
72+ // This line is optional. Access Transformers are automatically detected
73+ // accessTransformers = project.files('src/main/resources/META-INF/accesstransformer.cfg')
7174
72- server {
73- systemProperty ' forge.enabledGameTestNamespaces' , project. mod_id
74- programArgument ' --nogui'
75- }
75+ // Default run configurations.
76+ // These can be tweaked, removed, or duplicated as needed.
77+ runs {
78+ client {
79+ client()
80+
81+ // Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
82+ systemProperty ' neoforge.enabledGameTestNamespaces' , project. mod_id
83+ }
84+
85+ server {
86+ server()
87+ programArgument ' --nogui'
88+ systemProperty ' neoforge.enabledGameTestNamespaces' , project. mod_id
89+ }
7690
77- gameTestServer {
78- systemProperty ' forge.enabledGameTestNamespaces' , project. mod_id
91+ // This run config launches GameTestServer and runs all registered gametests, then exits.
92+ // By default, the server will crash when no gametests are provided.
93+ // The gametest system is also enabled by default for other run configs under the /test command.
94+ gameTestServer {
95+ type = " gameTestServer"
96+ systemProperty ' neoforge.enabledGameTestNamespaces' , project. mod_id
97+ }
98+
99+ data {
100+ data()
101+
102+ // example of overriding the workingDirectory set in configureEach above, uncomment if you want to use it
103+ // gameDirectory = project.file('run-data')
104+
105+ // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
106+ programArguments. addAll ' --mod' , project. mod_id, ' --all' , ' --output' , file(' src/generated/resources/' ). getAbsolutePath(), ' --existing' , file(' src/main/resources/' ). getAbsolutePath()
107+ }
108+
109+ // applies to all the run configs above
110+ configureEach {
111+ // Recommended logging data for a userdev environment
112+ // The markers can be added/remove as needed separated by commas.
113+ // "SCAN": For mods scan.
114+ // "REGISTRIES": For firing of registry events.
115+ // "REGISTRYDUMP": For getting the contents of all registries.
116+ systemProperty ' forge.logging.markers' , ' REGISTRIES'
117+
118+ // Recommended logging level for the console
119+ // You can set various levels here.
120+ // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
121+ logLevel = org.slf4j.event.Level . DEBUG
122+ }
79123 }
80124
81- data {
82- programArguments. addAll ' --mod' , project. mod_id, ' --all' , ' --output' , file(' src/generated/resources/' ). getAbsolutePath(), ' --existing' , file(' src/main/resources/' ). getAbsolutePath()
125+ mods {
126+ // define mod <-> source bindings
127+ // these are used to tell the game which sources are for which mod
128+ // multi mod projects should define one per mod
129+ " ${ mod_id} " {
130+ sourceSet(sourceSets. main)
131+ }
83132 }
84133}
85134
@@ -90,14 +139,13 @@ configurations {
90139}
91140
92141dependencies {
93- implementation " net.neoforged:neoforge:${ neo_version} "
94142 annotationProcessor ' org.spongepowered:mixin:0.8.5:processor'
95- runtimeOnly " mezz.jei:jei-1.20.6 -neoforge:18.0 .0.62 "
96- compileOnly " com.refinedmods:refinedstorage:1.13 .0-beta.4 "
97- runtimeOnly " com.refinedmods:refinedstorage:1.13 .0-beta.4 "
143+ runtimeOnly " mezz.jei:jei-1.21.1 -neoforge:19.21 .0.247 "
144+ compileOnly " com.refinedmods.refinedstorage :refinedstorage-neoforge:2.0 .0-beta.2 "
145+ runtimeOnly " com.refinedmods.refinedstorage :refinedstorage-neoforge:2.0 .0-beta.2 "
98146}
99147
100- tasks. withType( ProcessResources ). configureEach {
148+ var generateModMetadata = tasks. register( " generateModMetadata " , ProcessResources ) {
101149 var replaceProperties = [
102150 minecraft_version : minecraft_version,
103151 minecraft_version_range : minecraft_version_range,
@@ -112,12 +160,16 @@ tasks.withType(ProcessResources).configureEach {
112160 mod_description : mod_description
113161 ]
114162 inputs. properties replaceProperties
115-
116- filesMatching([' META-INF/mods.toml' ]) {
117- expand replaceProperties
118- }
163+ expand replaceProperties
164+ from " src/main/templates"
165+ into " build/generated/sources/modMetadata"
119166}
120167
168+ // Include the output of "generateModMetadata" as an input directory for the build
169+ // this works with both building through Gradle and the IDE.
170+ sourceSets. main. resources. srcDir generateModMetadata
171+ // To avoid having to run "generateModMetadata" manually, make it run on every project reload
172+ neoForge. ideSyncTask generateModMetadata
121173
122174tasks. withType(JavaCompile ). configureEach {
123175 options. encoding = ' UTF-8' // Use the UTF-8 charset for Java compilation
@@ -140,7 +192,7 @@ task publishCurseForge(type: net.darkhax.curseforgegradle.TaskPublishCurseForge)
140192 mainFile. releaseType = ' release'
141193 mainFile. changelog = ' A changelog can be found at https://github.com/Hexeption/RSInfinityBooster'
142194 mainFile. changelogType = ' markdown'
143- mainFile. gameVersions = [' 1.20.4 ' ]
195+ mainFile. gameVersions = [' 1.21.1 ' ]
144196 mainFile. addModLoader(" neoforge" )
145197 mainFile. displayName = " RSInfinityBooster ${ version} "
146198
@@ -153,9 +205,9 @@ modrinth {
153205 versionName = " RSInfinityBooster $version "
154206 changelog = ' A changelog can be found at https://github.com/Hexeption/RSInfinityBooster'
155207 uploadFile = jar
156- gameVersions = [" 1.20.4 " ]
208+ gameVersions = [" 1.21.1 " ]
157209 loaders = [" neoforge" ]
158210 dependencies {
159- required. version " refined-storage" , " 1.13 .0-beta.4 "
211+ required. version " refined-storage" , " 2.0 .0-beta.2 "
160212 }
161213}
0 commit comments