Skip to content

Commit 63a026e

Browse files
committed
Move to essential loom
1 parent 389c0f1 commit 63a026e

7 files changed

Lines changed: 50 additions & 19 deletions

File tree

.github/workflows/build.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,14 @@ jobs:
1515
- name: Checkout
1616
uses: actions/checkout@v4
1717

18-
- name: Set up JDK 21
18+
- name: Set up JDK 25
1919
uses: actions/setup-java@v4
2020
with:
21-
java-version: 21
2221
distribution: temurin
22+
java-version: |
23+
17
24+
21
25+
25
2326
2427
- name: Setup Gradle
2528
uses: gradle/actions/setup-gradle@v4

build.gradle.kts

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ plugins {
2929
buildscript {
3030
// Set loom platform to correct loader
3131
extra["loom.platform"] = project.name.split('-')[1]
32+
if (project.name[0] != '1') {
33+
extra.set("fabric.loom.disableObfuscation", "true")
34+
}
3235
}
3336

3437
val mcPlatform = Platform.fromProject(project)
@@ -70,6 +73,7 @@ val shadeModImplementation: Configuration by configurations.creating {
7073

7174
// Version definitions
7275
val mcVersion = VersionDefinition( // Used for pre releases and release candidates
76+
"26.1" to "26.1-pre-2",
7377
default = mcPlatform.versionString
7478
)
7579
val compatibleMcVersion = VersionDefinition(
@@ -82,9 +86,11 @@ val compatibleMcVersion = VersionDefinition(
8286
"1.21.8" to VersionRange("1.21.6", "1.21.8", name = "1.21.8"),
8387
"1.21.10" to VersionRange("1.21.9", "1.21.10", name = "1.21.10"),
8488
"1.21.11" to VersionRange("1.21.11", "1.21.11", name = "1.21.11"),
89+
"26.1" to VersionRange("26.1", "26.2", inclusive = false, name = "26.1")
8590
)
8691
val javaVersion = VersionDefinition(
8792
"1.20.1" to "17",
93+
"26.1" to "25",
8894
default = "21",
8995
)
9096
val parchmentVersion = VersionDefinition(
@@ -102,6 +108,7 @@ val fabricApiVersion = VersionDefinition(
102108
"1.21.8" to "0.129.0+1.21.8",
103109
"1.21.10" to "0.136.0+1.21.10",
104110
"1.21.11" to "0.139.4+1.21.11",
111+
"26.1" to "0.143.14+26.1",
105112
)
106113
val modMenuVersion = VersionDefinition(
107114
"1.20.1" to "7.2.2",
@@ -110,7 +117,8 @@ val modMenuVersion = VersionDefinition(
110117
"1.21.5" to "14.0.0",
111118
"1.21.8" to "15.0.0",
112119
"1.21.10" to "16.0.0-rc.1",
113-
"1.21.11" to "17.0.0-alpha.1"
120+
"1.21.11" to "17.0.0-alpha.1",
121+
"26.1" to "18.0.0-alpha.6",
114122
)
115123
val neoForgeVersion = VersionDefinition(
116124
"1.21.1" to "21.1.95",
@@ -143,19 +151,21 @@ val universalMcVersion = VersionDefinition(
143151
default = mcPlatform.versionString
144152
)
145153
val universalVersion = VersionDefinition(
146-
default = "${universalMcVersion.get(mcPlatform)}-${mcPlatform.loaderString}:446"
154+
default = "${universalMcVersion.get(mcPlatform)}-${mcPlatform.loaderString}:466"
147155
)
148156

149157
dependencies {
150158
minecraft("com.mojang:minecraft:${mcVersion.get(mcPlatform)}")
151159

152-
@Suppress("UnstableApiUsage")
153-
mappings(loom.layered {
154-
officialMojangMappings()
155-
parchmentVersion.getOrNull(mcPlatform)?.let {
156-
parchment("org.parchmentmc.data:parchment-$it@zip")
157-
}
158-
})
160+
if (mcPlatform.major == 1) {
161+
@Suppress("UnstableApiUsage")
162+
mappings(loom.layered {
163+
officialMojangMappings()
164+
parchmentVersion.getOrNull(mcPlatform)?.let {
165+
parchment("org.parchmentmc.data:parchment-$it@zip")
166+
}
167+
})
168+
}
159169

160170
if (mcPlatform.isFabric) {
161171
modImplementation("net.fabricmc:fabric-loader:0.17.3")

buildSrc/src/main/java/dev/dediamondpro/buildsource/Platform.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ public int getVersion() {
5353
}
5454

5555
public String getVersionString() {
56-
return major + "." + minor + "." + patch;
56+
if (patch != 0) {
57+
return major + "." + minor + "." + patch;
58+
}
59+
return major + "." + minor;
5760
}
5861

5962
public Loader getLoader() {
@@ -89,7 +92,10 @@ public static Platform fromProject(Project project) {
8992
String[] versionSplit = nameSplit[0].split("\\.");
9093
int major = Integer.parseInt(versionSplit[0]);
9194
int minor = Integer.parseInt(versionSplit[1]);
92-
int patch = Integer.parseInt(versionSplit[2]);
95+
int patch = 0;
96+
if (versionSplit.length > 2) {
97+
patch = Integer.parseInt(versionSplit[2]);
98+
}
9399
Loader loader = Loader.valueOf(nameSplit[1].toUpperCase());
94100
return new Platform(major, minor, patch, loader);
95101
}

buildSrc/src/main/java/dev/dediamondpro/buildsource/VersionRange.kt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class VersionRange(
2323
private val name: String = "$startVersion-$endVersion",
2424
private val openEnd: Boolean = false,
2525
private val allowAll: Boolean = false, // Mostly used for pre releases and release candidates
26+
private val inclusive: Boolean = true,
2627
) {
2728
fun getName(): String {
2829
return name;
@@ -34,11 +35,20 @@ class VersionRange(
3435

3536
fun getFabricRange(): String {
3637
if (allowAll) return "*"
37-
return ">=$startVersion" + if (!openEnd) " <=$endVersion" else ""
38+
return buildString {
39+
append(">= $startVersion")
40+
if (!openEnd && inclusive) append(" <=$endVersion")
41+
else if (!openEnd) append(" <$endVersion")
42+
}
3843
}
3944

4045
fun getForgeRange(): String {
4146
if (allowAll) return "[1,)"
42-
return "[$startVersion," + if (!openEnd) "$endVersion]" else ")"
47+
return buildString {
48+
append("[$startVersion,")
49+
if (!openEnd && inclusive) append("$endVersion]")
50+
else if (!openEnd) append("$endVersion[")
51+
else append(")")
52+
}
4353
}
4454
}

gradle/libs.versions.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[versions]
22
# Kotlin
3-
kotlin = "2.0.20"
3+
kotlin = "2.3.10"
44
fabric_language_kotlin = "1.11.0+kotlin.2.0.0" # Use 2.0.0 here since it is the minimum kotlin version we require
55

66
# Build system
7-
arch_loom = "1.13-SNAPSHOT"
7+
arch_loom = "1.15.45"
88
shadow = "8.1.1"
99
publishing = "0.8.3"
1010

@@ -31,7 +31,7 @@ tagsoup = { module = "org.ccil.cowan.tagsoup:tagsoup", version.ref = "tagsoup" }
3131
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
3232

3333
# Build system
34-
arch_loom = { id = "dev.architectury.loom", version.ref = "arch_loom" }
34+
arch_loom = { id = "gg.essential.loom", version.ref = "arch_loom" }
3535
shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadow" }
3636
publishing = { id = "me.modmuss50.mod-publish-plugin", version.ref = "publishing" }
3737

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

settings.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ pluginManagement {
2222
maven("https://maven.fabricmc.net")
2323
maven("https://maven.architectury.dev/")
2424
maven("https://maven.minecraftforge.net")
25+
maven("https://repo.essential.gg/repository/maven-public/")
2526
}
2627
dependencyResolutionManagement.versionCatalogs.create("libs")
2728
}
@@ -46,6 +47,7 @@ val platforms = listOf(
4647
"1.21.8-fabric",
4748
"1.21.10-fabric",
4849
"1.21.11-fabric",
50+
// "26.1-fabric",
4951
)
5052

5153
stonecutter {

0 commit comments

Comments
 (0)