From 0f4c2dbc434000c1c96beecead39493a59a6226e Mon Sep 17 00:00:00 2001 From: ziro Date: Sat, 4 Nov 2023 11:12:31 +0700 Subject: [PATCH] chore: Support NeoForge 1.20.2 1.20.2 NeoForge broke compat with LexForge by renaming their namespaces. --- build.gradle | 14 ++++++++------ gradle.properties | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- root.gradle.kts | 4 ++-- settings.gradle.kts | 2 ++ src/main/resources/META-INF/mods.toml | 2 +- versions/1.20.2-neoforge/gradle.properties | 1 + 7 files changed, 16 insertions(+), 11 deletions(-) create mode 100644 versions/1.20.2-neoforge/gradle.properties diff --git a/build.gradle b/build.gradle index 0b554504..cba8441e 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id "dev.architectury.loom" version "1.1-SNAPSHOT" + id "dev.architectury.loom" version "1.4-SNAPSHOT" id "com.github.johnrengelman.shadow" id "com.github.null2264.preprocess" id "me.modmuss50.mod-publish-plugin" version "0.3.5" @@ -47,6 +47,7 @@ repositories { maven { url = "https://maven.jamieswhiteshirt.com/libs-release" } maven { url = "https://maven.tterrag.com/" } maven { url = "https://maven.theillusivec4.top/" } + maven { url = "https://maven.neoforged.net/releases" } } archivesBaseName = project.archives_base_name @@ -116,11 +117,11 @@ dependencies { 11904: "1.19.4-45.1.0", 12001: "1.20.1-47.0.3", 12002: "1.20.2-48.0.13", - // TODO: 1.20.3 ][mcVersion] } else { - forge "net.neoforged:forge:" + [ - // TODO + forge "net.neoforged:neoforge:" + [ + 12002: "20.2.31-beta" + // TODO: 1.20.3 ][mcVersion] } } @@ -242,7 +243,7 @@ processResources { filteringCharset "UTF-8" filesMatching(isFabric ? "fabric.mod.json" : "META-INF/mods.toml") { - expand "version": metadataVersion, 'mcversion': metadataMCVersion + expand "version": metadataVersion, "mcversion": metadataMCVersion, "forge": (isNeo ? "neoforge" : "forge") } } @@ -292,7 +293,8 @@ publishMods { modLoaders.add("fabric") modLoaders.add("quilt") } else { - modLoaders.add("forge") + if (mcVersion <= 12001) // No more LexForge, LexForge is too buggy + modLoaders.add("forge") if (mcVersion >= 12001) modLoaders.add("neoforge") } diff --git a/gradle.properties b/gradle.properties index d34b9740..85acac65 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ org.gradle.jvmargs=-Xmx5G # Mod Properties -mod_version=5.1.1 +mod_version=5.1.2 version_stage=BETA maven_group=io.github.null2264 archives_base_name=cobblegen diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 3f2e44d6..185a6ce6 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1 +1 @@ -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip \ No newline at end of file +distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip \ No newline at end of file diff --git a/root.gradle.kts b/root.gradle.kts index dee685c2..e1b02636 100644 --- a/root.gradle.kts +++ b/root.gradle.kts @@ -3,7 +3,7 @@ plugins { } preprocess { - //val neo12002 = createNode("1.20.2-neoforge", 12002, "mojang") + val neo12002 = createNode("1.20.2-neoforge", 12002, "mojang") val forge12002 = createNode("1.20.2-forge", 12002, "mojang") val fabric12002 = createNode("1.20.2-fabric", 12002, "mojang") val forge12001 = createNode("1.20.1-forge", 12001, "mojang") @@ -15,7 +15,7 @@ preprocess { val forge11802 = createNode("1.18.2-forge", 11802, "mojang") val fabric11802 = createNode("1.18.2-fabric", 11802, "mojang") - //neo12002.link(fabric12002) + neo12002.link(fabric12002) forge12002.link(fabric12002) forge12001.link(fabric12001) diff --git a/settings.gradle.kts b/settings.gradle.kts index bbeb99e5..52213f83 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -5,6 +5,7 @@ pluginManagement { maven("https://jitpack.io/") maven("https://files.minecraftforge.net/maven/") maven("https://repo.essential.gg/repository/maven-public/") + maven("https://maven.neoforged.net/releases") gradlePluginPortal() } plugins { @@ -32,6 +33,7 @@ listOf( "1.20.1-forge", "1.20.2-fabric", "1.20.2-forge", + "1.20.2-neoforge", ).forEach { version -> include(":$version") project(":$version").apply { diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index a3aa42fe..f5262558 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -13,7 +13,7 @@ authors = "null2264" description = "An MC mod that allows you to customize cobblestone (stone and basalt) generators" [[dependencies.cobblegen]] -modId = "forge" +modId = "${forge}" mandatory = true versionRange = "[40,)" ordering = "NONE" diff --git a/versions/1.20.2-neoforge/gradle.properties b/versions/1.20.2-neoforge/gradle.properties new file mode 100644 index 00000000..32f842a6 --- /dev/null +++ b/versions/1.20.2-neoforge/gradle.properties @@ -0,0 +1 @@ +loom.platform=forge \ No newline at end of file