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/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 b1e6cfe0..fa7d1f60 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,8 +1,6 @@ pluginManagement { plugins { - id 'net.neoforged.gradle.userdev' version '7.0.150' 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 'net.neoforged.moddev' version '2.0.26-beta' apply false id 'fabric-loom' version '1.7-SNAPSHOT' apply false } repositories {