From dade323459573ac2250492643915d6d2854dbf80 Mon Sep 17 00:00:00 2001 From: Technici4n <13494793+Technici4n@users.noreply.github.com> Date: Wed, 4 Sep 2024 00:37:57 +0200 Subject: [PATCH 1/2] Convert NeoForge project to MDG --- NeoForge/build.gradle | 43 ++++++++++++++++++++++++------------------- settings.gradle | 2 +- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/NeoForge/build.gradle b/NeoForge/build.gradle index fb8dfb5e..3ddb03b7 100644 --- a/NeoForge/build.gradle +++ b/NeoForge/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java-library' id 'idea' - id 'net.neoforged.gradle.userdev' + id 'net.neoforged.moddev' id 'eclipse' } @@ -20,24 +20,33 @@ repositories { } } -runs { - configureEach { - workingDirectory project.file('../run') - systemProperty 'forge.logging.console.level', 'debug' - systemProperty 'fml.earlyprogresswindow', 'false' +neoForge { + version = "21.0.143" - modSource project.sourceSets.main + mods { + patchouli { + sourceSet sourceSets.main + } } - client { - } - server { - programArgument '--nogui' + runs { + configureEach { + gameDirectory = project.file('../run') + systemProperty 'forge.logging.console.level', 'debug' + systemProperty 'fml.earlyprogresswindow', 'false' + } + + client { + client() + } + server { + server() + programArgument '--nogui' + } } } dependencies { - implementation "net.neoforged:neoforge:21.0.143" implementation project(":Xplat") compileOnly "mezz.jei:jei-1.21-common-api:19.5.0.33" @@ -49,15 +58,11 @@ tasks.named('test').configure { enabled(false) } -TaskCollection.metaClass.excludingNeoTasks = { -> - delegate.matching { !it.name.startsWith("neo") } -} - -tasks.withType(JavaCompile).excludingNeoTasks().configureEach { +tasks.withType(JavaCompile).configureEach { source(project(":Xplat").sourceSets.main.allSource) } -tasks.withType(Javadoc).excludingNeoTasks().configureEach { +tasks.withType(Javadoc).configureEach { source(project(":Xplat").sourceSets.main.allJava) } @@ -65,7 +70,7 @@ tasks.named("sourcesJar", Jar) { from(project(":Xplat").sourceSets.main.allSource) } -tasks.withType(ProcessResources).excludingNeoTasks().configureEach { +tasks.withType(ProcessResources).configureEach { from project(":Xplat").sourceSets.main.resources } diff --git a/settings.gradle b/settings.gradle index b1e6cfe0..a745c0d6 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,6 +1,6 @@ pluginManagement { plugins { - id 'net.neoforged.gradle.userdev' version '7.0.150' apply false + id 'net.neoforged.moddev' version '2.0.26-beta' apply false id 'org.spongepowered.mixin' version '0.7-SNAPSHOT' apply false id 'org.spongepowered.gradle.vanilla' version '0.2.1-SNAPSHOT' apply false id 'fabric-loom' version '1.7-SNAPSHOT' apply false From 944a3cee5af3f29ecc9b303b378aeced9945234c Mon Sep 17 00:00:00 2001 From: Technici4n <13494793+Technici4n@users.noreply.github.com> Date: Wed, 4 Sep 2024 00:46:08 +0200 Subject: [PATCH 2/2] Convert Xplat project to MDG --- Xplat/build.gradle | 9 ++++++--- settings.gradle | 2 -- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Xplat/build.gradle b/Xplat/build.gradle index 28f3fec3..bcf41bc8 100644 --- a/Xplat/build.gradle +++ b/Xplat/build.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id 'org.spongepowered.gradle.vanilla' + id 'net.neoforged.moddev' } base { @@ -11,8 +11,11 @@ if (System.getenv().RELEASE_MODE == null) { version += '-SNAPSHOT' } -minecraft { - version(mc_version) +neoForge { + // To find the timestamp, see https://projects.neoforged.net/neoforged/neoform + neoFormVersion = "$mc_version-20240613.152323" + + addModdingDependenciesTo sourceSets.test } repositories { diff --git a/settings.gradle b/settings.gradle index a745c0d6..fa7d1f60 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,8 +1,6 @@ pluginManagement { plugins { id 'net.neoforged.moddev' version '2.0.26-beta' apply false - id 'org.spongepowered.mixin' version '0.7-SNAPSHOT' apply false - id 'org.spongepowered.gradle.vanilla' version '0.2.1-SNAPSHOT' apply false id 'fabric-loom' version '1.7-SNAPSHOT' apply false } repositories {