summaryrefslogtreecommitdiff
path: root/build.gradle
diff options
context:
space:
mode:
Diffstat (limited to 'build.gradle')
-rw-r--r--build.gradle114
1 files changed, 65 insertions, 49 deletions
diff --git a/build.gradle b/build.gradle
index 37d0dbc..d62cdb8 100644
--- a/build.gradle
+++ b/build.gradle
@@ -3,7 +3,7 @@ plugins {
id 'eclipse'
id 'idea'
id 'maven-publish'
- id 'net.neoforged.gradle.userdev' version '7.0.142'
+ id 'net.neoforged.moddev' version '0.1.99'
}
tasks.named('wrapper', Wrapper).configure {
@@ -29,52 +29,76 @@ base {
// Mojang ships Java 21 to end users starting in 1.20.5, so mods should target Java 21.
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
-//minecraft.accessTransformers.file rootProject.file('src/main/resources/META-INF/accesstransformer.cfg')
-//minecraft.accessTransformers.entry public net.minecraft.client.Minecraft textureManager # textureManager
-
-// Default run configurations.
-// These can be tweaked, removed, or duplicated as needed.
-runs {
- // applies to all the run configs below
- configureEach {
- // Recommended logging data for a userdev environment
- // The markers can be added/remove as needed separated by commas.
- // "SCAN": For mods scan.
- // "REGISTRIES": For firing of registry events.
- // "REGISTRYDUMP": For getting the contents of all registries.
- systemProperty 'forge.logging.markers', 'REGISTRIES'
-
- // Recommended logging level for the console
- // You can set various levels here.
- // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
- systemProperty 'forge.logging.console.level', 'debug'
-
- modSource project.sourceSets.main
- }
+neoForge {
+ // Specify the version of NeoForge to use.
+ version = project.neo_version
- client {
- // Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
- systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
+ parchment {
+ mappingsVersion = project.parchment_mappings_version
+ minecraftVersion = project.parchment_minecraft_version
}
- server {
- systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
- programArgument '--nogui'
- }
+ // This line is optional. Access Transformers are automatically detected
+ // accessTransformers.add('src/main/resources/META-INF/accesstransformer.cfg')
- // This run config launches GameTestServer and runs all registered gametests, then exits.
- // By default, the server will crash when no gametests are provided.
- // The gametest system is also enabled by default for other run configs under the /test command.
- gameTestServer {
- systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
- }
+ // Default run configurations.
+ // These can be tweaked, removed, or duplicated as needed.
+ runs {
+ client {
+ client()
+
+ // Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
+ systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
+ }
+
+ server {
+ server()
+ programArgument '--nogui'
+ systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
+ }
+
+ // This run config launches GameTestServer and runs all registered gametests, then exits.
+ // By default, the server will crash when no gametests are provided.
+ // The gametest system is also enabled by default for other run configs under the /test command.
+ gameTestServer {
+ type = "gameTestServer"
+ systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
+ }
- data {
- // example of overriding the workingDirectory set in configureEach above, uncomment if you want to use it
- // workingDirectory project.file('run-data')
+ data {
+ data()
- // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
- programArguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
+ // example of overriding the workingDirectory set in configureEach above, uncomment if you want to use it
+ // gameDirectory = project.file('run-data')
+
+ // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
+ programArguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
+ }
+
+ // applies to all the run configs above
+ configureEach {
+ // Recommended logging data for a userdev environment
+ // The markers can be added/remove as needed separated by commas.
+ // "SCAN": For mods scan.
+ // "REGISTRIES": For firing of registry events.
+ // "REGISTRYDUMP": For getting the contents of all registries.
+ systemProperty 'forge.logging.markers', 'REGISTRIES'
+
+ // Recommended logging level for the console
+ // You can set various levels here.
+ // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
+ logLevel = org.slf4j.event.Level.DEBUG
+ }
+ }
+
+ mods {
+ // define mod <-> source bindings
+ // these are used to tell the game which sources are for which mod
+ // mostly optional in a single mod project
+ // but multi mod projects should define one per mod
+ "${mod_id}" {
+ sourceSet(sourceSets.main)
+ }
}
}
@@ -90,14 +114,6 @@ configurations {
}
dependencies {
- // Specify the version of Minecraft to use.
- // Depending on the plugin applied there are several options. We will assume you applied the userdev plugin as shown above.
- // The group for userdev is net.neoforged, the module name is neoforge, and the version is the same as the neoforge version.
- // You can however also use the vanilla plugin (net.neoforged.gradle.vanilla) to use a version of Minecraft without the neoforge loader.
- // And its provides the option to then use net.minecraft as the group, and one of; client, server or joined as the module name, plus the game version as version.
- // For all intends and purposes: You can treat this dependency as if it is a normal library you would use.
- implementation "net.neoforged:neoforge:${neo_version}"
-
// Example optional mod dependency with JEI
// The JEI API is declared for compile time use, while the full JEI artifact is used at runtime
// compileOnly "mezz.jei:jei-${mc_version}-common-api:${jei_version}"