Skip to content

Commit 289e42e

Browse files
committed
Merge branch 'master' into 26.1
2 parents 1aca07b + 6243f1b commit 289e42e

File tree

75 files changed

+185
-113
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+185
-113
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
build:
3737
runs-on: ubuntu-latest
3838
steps:
39-
- uses: actions/checkout@v4
39+
- uses: actions/checkout@v5
4040

4141
- name: update cache
4242
uses: actions/cache@v4
@@ -49,7 +49,7 @@ jobs:
4949
${{ runner.os }}-gradle-
5050
5151
- name: Set up Gradle JDK
52-
uses: actions/setup-java@v4
52+
uses: actions/setup-java@v5
5353
with:
5454
distribution: 'temurin'
5555
java-version: '21'

.github/workflows/deploy_all.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
deploy-all:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v4
15+
- uses: actions/checkout@v5
1616

1717
- name: Fetch all branches
1818
run: |
@@ -37,7 +37,7 @@ jobs:
3737
${{ runner.os }}-gradle-
3838
3939
- name: Set up Gradle JDK
40-
uses: actions/setup-java@v4
40+
uses: actions/setup-java@v5
4141
with:
4242
distribution: 'temurin'
4343
java-version: '21'

.github/workflows/rebuild_cache.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
build:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v4
9+
- uses: actions/checkout@v5
1010
with:
1111
fetch-depth: 0
1212

@@ -32,7 +32,7 @@ jobs:
3232
${{ runner.os }}-gradle-
3333
3434
- name: Set up Gradle JDK
35-
uses: actions/setup-java@v4
35+
uses: actions/setup-java@v5
3636
with:
3737
distribution: 'temurin'
3838
java-version: '21'

HEADER

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* MIT License
33
*
4-
* Copyright (c) 2018 - 2025 CDAGaming ([email protected])
4+
* Copyright (c) 2018 - 2026 CDAGaming ([email protected])
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2018 - 2025 CDAGaming ([email protected])
3+
Copyright (c) 2018 - 2026 CDAGaming ([email protected])
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

build.gradle.kts

Lines changed: 93 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ import java.util.*
99

1010
plugins {
1111
java
12-
id("xyz.wagyourtail.unimined") version "1.3.14+neofix.1" apply false
13-
id("xyz.wagyourtail.jvmdowngrader") version "1.2.2"
14-
id("com.diffplug.gradle.spotless") version "8.0.0" apply false
15-
id("com.gradleup.shadow") version "9.2.2" apply false
12+
id("dev.firstdark.unimined") version "1.0.3+1.4.2-SNAPSHOT" apply false
13+
id("xyz.wagyourtail.jvmdowngrader") version "1.3.5"
14+
id("com.diffplug.gradle.spotless") version "8.1.0" apply false
15+
id("com.gradleup.shadow") version "9.3.0" apply false
1616
id("com.hypherionmc.modutils.modpublisher") version "2.1.8+snapshot.3" apply false
1717
}
1818

@@ -41,6 +41,7 @@ val extProtocol = "mc_protocol"()!!.toInt()
4141
val extIsLegacy = "isLegacy"()!!.toBoolean()
4242
val extIsJarMod = "isJarMod"()!!.toBoolean()
4343
val extIsModern = !extIsLegacy && extProtocol >= 498
44+
val extIsOfficial = "mc_mappings_type"() == "official"
4445
val extIsMCPJar = extIsJarMod && "mc_mappings_type"() == "mcp"
4546

4647
// Only apply ATs to forge on non-legacy builds, or on Legacy Protocols above 1.5
@@ -60,7 +61,7 @@ subprojects {
6061
val isLoaderSource = path != ":common"
6162

6263
apply(plugin = "java")
63-
apply(plugin = "xyz.wagyourtail.unimined")
64+
apply(plugin = "dev.firstdark.unimined")
6465
apply(plugin = "xyz.wagyourtail.jvmdowngrader")
6566
apply(plugin = "com.diffplug.spotless")
6667
apply(plugin = "com.gradleup.shadow")
@@ -80,6 +81,7 @@ subprojects {
8081
val isLegacy by extra(extIsLegacy)
8182
val isJarMod by extra(extIsJarMod)
8283
val isModern by extra(extIsModern)
84+
val isOfficial by extra(extIsOfficial)
8385
val isMCPJar by extra(extIsMCPJar)
8486
val accessWidenerFile by extra(extAWFile)
8587
val canUseATs by extra(extCanUseATs)
@@ -170,8 +172,82 @@ subprojects {
170172
version(mcVersion)
171173

172174
mappings {
173-
devNamespace("official")
174-
devFallbackNamespace("official")
175+
if (isOfficial) {
176+
devNamespace("official")
177+
devFallbackNamespace("official")
178+
} else {
179+
val mcMappings = "mc_mappings"()!!
180+
when (mcMappingsType) {
181+
"mcp" -> {
182+
if (!isJarMod) {
183+
searge()
184+
}
185+
mcp((if (isJarMod) "legacy" else "stable"), mcMappings)
186+
}
187+
188+
"forgeMCP" -> {
189+
forgeBuiltinMCP("forge_version"()!!)
190+
}
191+
192+
"retroMCP" -> {
193+
retroMCP(mcMappings)
194+
}
195+
196+
"mojmap" -> {
197+
mojmap()
198+
}
199+
200+
else -> throw GradleException("Unknown or Unsupported Mappings version")
201+
}
202+
203+
// Only use Intermediaries on Versions that support it
204+
val usingIntermediary = (isLegacy && protocol >= 39) || !isLegacy
205+
if (usingIntermediary) {
206+
if (isModern) {
207+
intermediary()
208+
} else {
209+
legacyIntermediary()
210+
}
211+
}
212+
213+
// ability to add custom mappings
214+
stubs("official", mcMappingsType!!) {
215+
c("ModLoader", "net/minecraft/src/ModLoader")
216+
c("BaseMod", "net/minecraft/src/BaseMod")
217+
// Fix: Fixed an inconsistent mapping in 1.16 and 1.16.1 between MCP and Mojmap
218+
if (!isLegacy && (protocol == 735 || protocol == 736)) {
219+
c(
220+
"dng",
221+
"net/minecraft/client/gui/components/AbstractWidget"
222+
) {
223+
m("e;()I", "func_238483_d_", "getHeightRealms")
224+
}
225+
}
226+
}
227+
228+
if (isMCPJar) {
229+
if (protocol <= 2) { // MC a1.1.2_01 and below
230+
devNamespace("searge")
231+
} else {
232+
devFallbackNamespace("searge")
233+
}
234+
} else if (usingIntermediary) {
235+
devFallbackNamespace("intermediary")
236+
}
237+
}
238+
239+
if (shouldDowngrade) {
240+
val apiVersion = if (buildVersion.isJava7) JavaVersion.VERSION_1_8 else buildVersion
241+
val downgradeClient = tasks.register("downgradeClient", DowngradeFiles::class.java) {
242+
inputCollection = sourceSet.output.classesDirs + sourceSet.runtimeClasspath
243+
classpath = project.files()
244+
outputCollection.files
245+
}
246+
247+
runs.config("client") {
248+
classpath = downgradeClient.get().outputCollection + files(jvmdg.getDowngradedApi(apiVersion))
249+
}
250+
}
175251
}
176252

177253
minecraftRemapper.config {
@@ -187,14 +263,15 @@ subprojects {
187263
val libName = if (!isLoaderSource) "fabric" else name
188264
val libVersion = "unilib_build_version"()!!
189265
val libFile = "$libName${if (canDowngrade) "-native" else ""}"
266+
val libGrab = if (isOfficial) "implementation" else "modImplementation"
190267

191268
dependencies {
192269
// Annotations
193270
"compileOnly"("com.google.code.findbugs:jsr305:3.0.2")
194-
"compileOnly"("com.github.spotbugs:spotbugs-annotations:4.9.6")
271+
"compileOnly"("com.github.spotbugs:spotbugs-annotations:4.9.8")
195272

196273
// Attach UniLib dependency
197-
"implementation"(
274+
libGrab(
198275
"com.gitlab.cdagaming.unilib:$libPrefix-${
199276
libName.replaceFirstChar {
200277
if (it.isLowerCase()) it.titlecase(
@@ -231,6 +308,7 @@ subprojects {
231308
}
232309

233310
val relocatePath = "$modId.external"
311+
val uniLibPath = "unilib.external"
234312

235313
tasks.named<ShadowJar>("shadowJar").configure {
236314
// Meta Exclusions
@@ -269,14 +347,15 @@ subprojects {
269347
exclude("META-INF/native-image/com.kohlschutter.junixsocket/junixsocket-native-arm*/**")
270348

271349
// Package Relocations
272-
relocate("net.lenni0451", "$relocatePath.net.lenni0451")
273350
relocate("com.jagrosh", "$relocatePath.com.jagrosh")
274351
relocate("org.meteordev", "$relocatePath.org.meteordev")
275-
relocate("io.github.classgraph", "$relocatePath.io.github.classgraph")
276-
relocate("nonapi.io.github.classgraph", "$relocatePath.nonapi.io.github.classgraph")
352+
// UniLib Relocations
353+
relocate("net.lenni0451", "$uniLibPath.net.lenni0451")
354+
relocate("io.github.classgraph", "$uniLibPath.io.github.classgraph")
355+
relocate("nonapi.io.github.classgraph", "$uniLibPath.nonapi.io.github.classgraph")
277356
if (protocol < 755) {
278-
relocate("org.slf4j", "$relocatePath.org.slf4j")
279-
relocate("org.apache.logging.slf4j", "$relocatePath.org.apache.logging.slf4j")
357+
relocate("org.slf4j", "$uniLibPath.org.slf4j")
358+
relocate("org.apache.logging.slf4j", "$uniLibPath.org.apache.logging.slf4j")
280359
}
281360
// Integration Relocations
282361
if (!isLegacy) {

common/build.gradle.kts

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ unimined.minecraft {
3030
accessWidener(accessWidenerFile)
3131
}
3232
loader("fabric_loader_version"()!!)
33-
customIntermediaries = true
33+
customIntermediaries = (minecraftData.mcVersionCompare(version, "1.6.4") < 0)
3434
}
3535
if (isModern) {
3636
fabric(fabricData)
@@ -51,7 +51,7 @@ dependencies {
5151
// Legacy Dependencies, based on Protocol Version
5252
if (isLegacy) {
5353
if (protocol <= 61) { // MC 1.5.2 and below
54-
shade("com.google.code.gson:gson:2.2.2")
54+
implementation("com.google.code.gson:gson:2.2.2")
5555
}
5656
}
5757

@@ -60,30 +60,22 @@ dependencies {
6060
shade("com.kohlschutter.junixsocket:junixsocket-native-common:${"junixsocket_version"()!!}")
6161

6262
// LeniReflect
63-
shade("net.lenni0451:Reflect:${"reflect_version"()!!}")
63+
implementation("net.lenni0451:Reflect:${"reflect_version"()!!}")
6464

6565
// DiscordIPC (Originally by jagrosh)
6666
shade("io.github.cdagaming:DiscordIPC:${"ipc_version"()!!}") {
6767
isTransitive = false
6868
}
6969
// StarScript (Used for Placeholder Expressions)
7070
shade("io.github.cdagaming:starscript:${"starscript_version"()!!}")
71-
shade("io.github.classgraph:classgraph:${"classgraph_version"()!!}")
71+
implementation("io.github.classgraph:classgraph:${"classgraph_version"()!!}")
7272
// SLF4J Dependencies (If below 1.17)
7373
if (isLegacy || protocol < 755) {
74-
shade("org.slf4j:slf4j-api:1.7.36")
74+
implementation("org.slf4j:slf4j-api:1.7.36")
7575
if (isLegacy) {
76-
shade("org.slf4j:slf4j-jdk14:1.7.36")
76+
implementation("org.slf4j:slf4j-jdk14:1.7.36")
7777
} else {
7878
runtime("org.slf4j:slf4j-jdk14:1.7.36")
79-
80-
// 17w15a (1.12) and higher use 2.x's full releases of Log4j
81-
// while anything below that uses (Or should be using) the *fixed* version of 2.0-beta9
82-
val log4jVersion = if (protocol >= 321) "2.0" else "2.0-beta9"
83-
shadeOnly("org.apache.logging.log4j:log4j-slf4j-impl:$log4jVersion") {
84-
exclude(group = "org.apache.logging.log4j", module = "log4j-api")
85-
exclude(group = "org.apache.logging.log4j", module = "log4j-core")
86-
}
8779
}
8880
}
8981

common/src/main/java/com/gitlab/cdagaming/craftpresence/CraftPresence.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* MIT License
33
*
4-
* Copyright (c) 2018 - 2025 CDAGaming ([email protected])
4+
* Copyright (c) 2018 - 2026 CDAGaming ([email protected])
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal

common/src/main/java/com/gitlab/cdagaming/craftpresence/config/gui/AboutGui.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* MIT License
33
*
4-
* Copyright (c) 2018 - 2025 CDAGaming ([email protected])
4+
* Copyright (c) 2018 - 2026 CDAGaming ([email protected])
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal

common/src/main/java/com/gitlab/cdagaming/craftpresence/config/gui/AccessibilitySettingsGui.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* MIT License
33
*
4-
* Copyright (c) 2018 - 2025 CDAGaming ([email protected])
4+
* Copyright (c) 2018 - 2026 CDAGaming ([email protected])
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)