From 57ea4f6daa07ca7be29ead896fd8ce535b8a732a Mon Sep 17 00:00:00 2001 From: Puqns67 Date: Mon, 5 Aug 2024 14:28:23 +0800 Subject: [PATCH] build: use net.neoforged.moddev to build --- build.gradle.kts | 27 +++++++++++++++++---------- gradle.properties | 3 ++- settings.gradle.kts | 7 +++++-- 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index d28e303..ec55da5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -16,12 +16,9 @@ fun getVersionType(version: String): String { } } -// Need to be set for neoforge -java.toolchain.languageVersion = JavaLanguageVersion.of(javaVersion) - plugins { id("java") - id("net.neoforged.gradle.userdev") version "7.0.153" + id("net.neoforged.moddev") version "2.0.1-beta" id("com.modrinth.minotaur") version "2.8.7" id("idea") } @@ -31,19 +28,29 @@ base { version = "${modVersion}+mc${minecraftVersion}" } -dependencies { - implementation("net.neoforged:neoforge:${loaderVersion}") -} - java { sourceCompatibility = JavaVersion.valueOf("VERSION_${javaVersion}") targetCompatibility = JavaVersion.valueOf("VERSION_${javaVersion}") } -subsystems { +neoForge { + version = loaderVersion + + mods { + register(modId) { + sourceSet(sourceSets["main"]) + } + } + + runs { + create("client") { + client() + } + } + parchment { minecraftVersion = property("minecraft_version").toString() - mappingsVersion = "2024.07.07" + mappingsVersion = property("parchment_version").toString() } } diff --git a/gradle.properties b/gradle.properties index 6fc55d6..065464f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,9 +7,10 @@ org.gradle.debug=false java_version=21 minecraft_version=1.21 minecraft_version_range=[1.21,1.22) -neoforge_version=21.0.76-beta +neoforge_version=21.0.143 neoforge_version_range=[21.0,) fml_version_range=[2,) +parchment_version=2024.07.28 ## Mod Properties mod_id=skintypefix diff --git a/settings.gradle.kts b/settings.gradle.kts index cc55db0..f1d1330 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,12 +1,15 @@ pluginManagement { repositories { mavenLocal() + gradlePluginPortal() + mavenCentral() maven { name = "Neoforged" url = uri("https://maven.neoforged.net/releases") + content { + includeGroup("net.neoforged") + } } - gradlePluginPortal() - mavenCentral() } }