diff --git a/mod-shared/build.gradle b/mod-shared/build.gradle index 502d7df6..4e80d7fa 100644 --- a/mod-shared/build.gradle +++ b/mod-shared/build.gradle @@ -54,5 +54,8 @@ sourceSets { } tasks.jar { - manifest.attributes("FMLModType": "GAMELIBRARY") + manifest.attributes( + "FMLModType": "GAMELIBRARY", + "Automatic-Module-Name": "net.kyori.adventure.platform.mod.shared" + ) } diff --git a/neoforge/build.gradle.kts b/neoforge/build.gradle.kts index 7737c9fc..558224b7 100644 --- a/neoforge/build.gradle.kts +++ b/neoforge/build.gradle.kts @@ -1,5 +1,3 @@ -import net.neoforged.moddevgradle.internal.RunGameTask - plugins { id("net.neoforged.moddev") id("publishing-conventions") @@ -17,11 +15,9 @@ neoForge { runs { register("client") { client() - mods.set(emptySet()) // Work around classpath issues by using the production jar for dev runs } register("server") { server() - mods.set(emptySet()) // Work around classpath issues by using the production jar for dev runs } } @@ -32,25 +28,16 @@ neoForge { } } -// Work around classpath issues by using the production jar for dev runs -tasks.withType().configureEach { - dependsOn(tasks.jar) - doFirst { - val jar = file("run/mods/main.jar") - jar.parentFile.mkdirs() - tasks.jar.get().archiveFile.get().asFile.copyTo(jar, true) - } -} - configurations.jarJar { extendsFrom(configurations.jarInJar.get()) } dependencies { + additionalRuntimeClasspath(project(":adventure-platform-neoforge:adventure-platform-neoforge-services")) implementation(project(":adventure-platform-neoforge:adventure-platform-neoforge-services")) jarJar(project(":adventure-platform-neoforge:adventure-platform-neoforge-services")) - compileOnlyApi(project(":adventure-platform-mod-shared")) + api(project(":adventure-platform-mod-shared")) jarJar(project(":adventure-platform-mod-shared")) } diff --git a/neoforge/tester/build.gradle.kts b/neoforge/tester/build.gradle.kts index 14aee9ca..fbc41ca1 100644 --- a/neoforge/tester/build.gradle.kts +++ b/neoforge/tester/build.gradle.kts @@ -1,6 +1,3 @@ -import java.nio.file.Files -import net.neoforged.moddevgradle.internal.RunGameTask - plugins { id("net.neoforged.moddev") alias(libs.plugins.indra.checkstyle) @@ -14,17 +11,16 @@ neoForge { runs { register("client") { client() - mods.set(HashSet()) } register("server") { server() - mods.set(HashSet()) } } mods { register("adventure-platform-neoforge-tester") { sourceSet(sourceSets.main.get()) + sourceSet(project(":test-resources").sourceSets.main.get()) } } } @@ -33,16 +29,6 @@ tasks.jar { from(project(":test-resources").sourceSets.main.get().output) } -tasks.withType(RunGameTask::class.java).configureEach { - dependsOn(tasks.jar) - doFirst { - val jar = file("run/mods/main.jar") - jar.parentFile.mkdirs() - if (jar.exists()) jar.delete() - Files.copy(tasks.jar.get().archiveFile.get().asFile.toPath(), jar.toPath()) - } -} - dependencies { implementation(project(":adventure-platform-neoforge")) jarJar(project(":adventure-platform-neoforge")) diff --git a/settings.gradle.kts b/settings.gradle.kts index 1605e793..70039e43 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -20,7 +20,7 @@ pluginManagement { plugins { id("org.gradle.toolchains.foojay-resolver-convention") version "0.9.0" id("fabric-loom") version "1.9.2" - id("net.neoforged.moddev.repositories") version "1.0.23" + id("net.neoforged.moddev.repositories") version "2.0.52-beta" } rootProject.name = "adventure-platform-mod-parent"