Skip to content

Commit

Permalink
chore: Support NeoForge 1.20.2
Browse files Browse the repository at this point in the history
1.20.2 NeoForge broke compat with LexForge by renaming their namespaces.
  • Loading branch information
null2264 committed Nov 4, 2023
1 parent 00ff1ce commit 0f4c2db
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 11 deletions.
14 changes: 8 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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]
}
}
Expand Down Expand Up @@ -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")
}
}

Expand Down Expand Up @@ -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")
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
4 changes: 2 additions & 2 deletions root.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions versions/1.20.2-neoforge/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
loom.platform=forge

0 comments on commit 0f4c2db

Please sign in to comment.