Skip to content

Commit

Permalink
feat: NeoForge snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
null2264 committed Mar 28, 2024
1 parent d6e3c95 commit 0023706
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
with:
distribution: temurin
java-version: 17
- name: Compile NeoForge snapshot
run: ./.scripts/compile_kits.sh
- run: chmod +x ./gradlew
- uses: actions/cache@v4
with:
Expand Down
23 changes: 23 additions & 0 deletions .scripts/compile_kits.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

# REF: https://github.com/embeddedt/embeddium/blob/310ff4ca5d5a0ba49c72f2011d51f35d7308f57f/scripts/compile_kits.sh

set -e

function prop {
grep "${1}" gradle.properties | cut -d'=' -f2
}

MC_VERSION=$(prop minecraft_version)

if [[ $MC_VERSION == *"w"** ]]; then
branch=port/${MC_VERSION}
echo "Detected MC snapshot ${MC_VERSION}"
cd $(mktemp -d)
echo "Downloading Kits ${branch}..."
git clone -q -b ${branch} --depth 1 https://github.com/neoforged/NeoForge Kits >/dev/null
cd Kits
echo "Compiling Kits"
./gradlew neoforge:setup
./gradlew neoforge:publishToMavenLocal
fi
7 changes: 5 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ repositories {
maven { url = "https://maven.theillusivec4.top/" }
maven { url = "https://maven.neoforged.net/releases" }
maven { url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/" }
mavenLocal()
}

archivesBaseName = project.archives_base_name
Expand Down Expand Up @@ -91,7 +92,7 @@ configurations {
dependencies {
// TODO(addingVersion): For snapshots
def mc = [
12005: "24w09a"
12005: "24w12a",
]
minecraft "com.mojang:minecraft:${mc[mcVersion] ?: mcVersionStr}"

Expand Down Expand Up @@ -131,6 +132,7 @@ dependencies {
// TODO(addingVersion)
neoForge "net.neoforged:neoforge:" + [
12002: "20.2.86",
12005: "20.5.0-alpha.${mc[mcVersion]}.+",
][mcVersion]
}
}
Expand Down Expand Up @@ -167,6 +169,7 @@ dependencies {
11904: "1.19.4",
12001: "1.20.1",
12002: "1.20.2",
12005: "1.20.2", // FIXME: Use 1.20.5 version of EMI
]
// EMI support multiple platform since 1.0.0
// EMI seems to also skip 1.19 and 1.19.1
Expand Down Expand Up @@ -344,7 +347,7 @@ def cfSnapshots = [
][mcVersion]

def mrSnapshots = [
12005: ["24w09a"],
12005: ["24w12a"],
][mcVersion]

publishMods {
Expand Down
6 changes: 3 additions & 3 deletions root.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

preprocess {
//val neo12005 = createNode("1.20.5-neoforge", 12005, "mojang")
val neo12005 = createNode("1.20.5-neoforge", 12005, "mojang")
val fabric12005 = createNode("1.20.5-fabric", 12005, "mojang")
val neo12002 = createNode("1.20.2-neoforge", 12002, "mojang")
val fabric12002 = createNode("1.20.2-fabric", 12002, "mojang")
Expand All @@ -16,7 +16,7 @@ preprocess {
val forge11605 = createNode("1.16.5-forge", 11605, "mojang")
val fabric11605 = createNode("1.16.5-fabric", 11605, "mojang")

//neo12005.link(fabric12005)
neo12005.link(fabric12005)
neo12002.link(fabric12002)

forge12001.link(fabric12001)
Expand All @@ -29,4 +29,4 @@ preprocess {
fabric12001.link(fabric11902)
fabric11902.link(fabric11802)
fabric11802.link(fabric11605)
}
}
4 changes: 2 additions & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ listOf(
"1.20.2-fabric",
"1.20.2-neoforge",
"1.20.5-fabric",
//"1.20.5-neoforge",
"1.20.5-neoforge",
).forEach { version ->
include(":$version")
project(":$version").apply {
projectDir = file("versions/$version")
buildFileName = "../../build.gradle"
}
}
}

0 comments on commit 0023706

Please sign in to comment.