Skip to content

Commit 2458e29

Browse files
Merge branch '1.21.8' into 1.21.4
2 parents 7120b3a + 36523a8 commit 2458e29

Some content is hidden

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

45 files changed

+1508
-1150
lines changed

.github/workflows/auto_snapshot_update.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ jobs:
6363
run: |
6464
./gradlew migrateMappings --mappings ${{ inputs.yarn_mappings }} --overrideInputsIHaveABackup
6565
./gradlew migrateTestMappings --mappings ${{ inputs.yarn_mappings }} --overrideInputsIHaveABackup
66+
./gradlew migrateClassTweakerMappings --mappings ${{ inputs.yarn_mappings }} --overrideInputsIHaveABackup
6667
6768
- name: Update version constants
6869
run: |

.github/workflows/gradle.yml

Lines changed: 20 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -87,57 +87,34 @@ jobs:
8787
done
8888
echo "</details>" >> $GITHUB_STEP_SUMMARY
8989
90-
- name: Run the mod and take screenshots
91-
# TODO: Migrate to Fabric Client Gametest API so this can run with configuration cache enabled
92-
run: xvfb-run --auto-servernum ./gradlew runEndToEndTest --stacktrace --warning-mode=fail --no-configuration-cache
90+
- name: Run client gametests
91+
env:
92+
IMGUR_CLIENT_ID: ${{ secrets.IMGUR_CLIENT_ID }}
93+
run: xvfb-run --auto-servernum ./gradlew runClientGameTest --stacktrace --warning-mode=fail
94+
95+
- name: Run client gametests with mods
96+
env:
97+
IMGUR_CLIENT_ID: ${{ secrets.IMGUR_CLIENT_ID }}
98+
run: xvfb-run --auto-servernum ./gradlew runClientGameTestWithMods --stacktrace --warning-mode=fail
9399

94-
- name: Upload screenshots.zip artifact
100+
- name: Upload screenshots
95101
uses: actions/upload-artifact@v5
96102
if: ${{ success() || failure() }}
97103
with:
98104
name: screenshots
99-
path: run/screenshots
105+
path: build/run/*/screenshots
100106
compression-level: 0
101107

102-
- name: Upload crash-reports.zip artifact
108+
- name: Upload logs
109+
uses: actions/upload-artifact@v5
110+
if: ${{ success() || failure() }}
111+
with:
112+
name: logs
113+
path: build/run/*/logs/latest.log
114+
115+
- name: Upload crash reports
103116
uses: actions/upload-artifact@v5
104117
if: ${{ failure() }}
105118
with:
106119
name: crash-reports
107-
path: run/crash-reports
108-
109-
- name: Create test screenshot gallery
110-
env:
111-
IMGUR_CLIENT_ID: ${{ secrets.IMGUR_CLIENT_ID }}
112-
if: ${{ env.IMGUR_CLIENT_ID && (success() || failure()) }}
113-
# Imgur uploads randomly fail sometimes, probably because of the low rate limit.
114-
# TODO: Find a better place to upload the screenshots.
115-
continue-on-error: true
116-
run: |
117-
echo "<details open>" >> $GITHUB_STEP_SUMMARY
118-
echo "<summary>📸 Test Screenshots</summary>" >> $GITHUB_STEP_SUMMARY
119-
echo "" >> $GITHUB_STEP_SUMMARY
120-
for img in run/screenshots/*.png; do
121-
if [ -f "$img" ]; then
122-
filename=$(basename "$img")
123-
name_without_ext="${filename%.*}"
124-
# Upload to Imgur
125-
response=$(curl -s -X POST \
126-
-H "Authorization: Client-ID $IMGUR_CLIENT_ID" \
127-
-F "image=@$img" \
128-
https://api.imgur.com/3/image)
129-
# Extract the URL from the response
130-
url=$(echo $response | grep -o '"link":"[^"]*"' | cut -d'"' -f4)
131-
if [ ! -z "$url" ]; then
132-
# Convert underscores to spaces and capitalize first letter of each word
133-
title=$(echo "$name_without_ext" | tr '_' ' ' | awk '{for(i=1;i<=NF;i++)sub(/./,toupper(substr($i,1,1)),$i)}1')
134-
echo "### $title" >> $GITHUB_STEP_SUMMARY
135-
echo "![${name_without_ext}]($url)" >> $GITHUB_STEP_SUMMARY
136-
echo "" >> $GITHUB_STEP_SUMMARY
137-
else
138-
echo "Failed to upload $filename" >> $GITHUB_STEP_SUMMARY
139-
echo "Imgur upload response for $filename: $response"
140-
fi
141-
fi
142-
done
143-
echo "</details>" >> $GITHUB_STEP_SUMMARY
120+
path: build/run/*/crash-reports

build.gradle

Lines changed: 48 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@ buildscript {
22
dependencies {
33
classpath "org.kohsuke:github-api:1.330"
44
}
5-
6-
configurations.classpath {
7-
resolutionStrategy {
8-
// v28.0-jre, used by fabric-loom 1.13.3, is vulnerable to CVE-2020-8908 and CVE-2023-2976
9-
force "com.google.guava:guava:32.0.1-jre"
10-
}
11-
}
125
}
136

147
plugins {
@@ -31,27 +24,16 @@ repositories {
3124
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
3225
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
3326
// for more information about repositories.
34-
}
35-
36-
// Override vulnerable dependencies until Minecraft updates to newer versions
37-
configurations.all {
38-
resolutionStrategy {
39-
// v2.5.1, used by Minecraft 1.21.4 - 1.21.10, is vulnerable to CVE-2024-57699
40-
force "net.minidev:json-smart:2.5.2"
41-
// v2.13.4, used by Minecraft 1.21.4 - 1.21.10, is vulnerable to CVE-2025-52999
42-
force "com.fasterxml.jackson.core:jackson-core:2.15.0"
43-
// v3.17.0, used by Minecraft 1.21.4 - 1.21.10, is vulnerable to CVE-2025-48924
44-
force "org.apache.commons:commons-lang3:3.18.0"
45-
// v9.40, used by Minecraft 1.21.4 - 1.21.10, is vulnerable to CVE-2025-53864
46-
force "com.nimbusds:nimbus-jose-jwt:10.0.2"
47-
// v4.1.115.Final, used by Minecraft 1.21.4, is vulnerable to CVE-2025-25193
48-
force "io.netty:netty-common:4.1.118.Final"
49-
// v4.1.115.Final, used by Minecraft 1.21.4, is vulnerable to CVE-2025-24970
50-
force "io.netty:netty-handler:4.1.118.Final"
51-
// v4.1.115.Final, used by Minecraft 1.21.4, is vulnerable to CVE-2025-58057
52-
force "io.netty:netty-codec:4.1.125.Final"
53-
// v4.1.115.Final, used by Minecraft 1.21.4, is vulnerable to CVE-2025-58056
54-
force "io.netty:netty-codec-http:4.1.125.Final"
27+
exclusiveContent {
28+
forRepository {
29+
maven {
30+
name = "Modrinth"
31+
url = "https://api.modrinth.com/maven"
32+
}
33+
}
34+
filter {
35+
includeGroup "maven.modrinth"
36+
}
5537
}
5638
}
5739

@@ -74,53 +56,53 @@ dependencies {
7456
modImplementation "com.google.code.findbugs:jsr305:3.0.2"
7557
}
7658

59+
fabricApi.configureTests {
60+
createSourceSet = true
61+
enableGameTests = false
62+
enableClientGameTests = true
63+
modId = "wurst_testmod"
64+
username = "Wurst-Bot"
65+
}
66+
7767
loom {
7868
accessWidenerPath = file("src/main/resources/wurst.accesswidener")
69+
70+
runs {
71+
clientGameTestWithMods {
72+
inherit client
73+
source = sourceSets.gametest
74+
runDir = "build/run/clientGameTestWithMods"
75+
vmArgs.add("-Dfabric.client.gametest")
76+
vmArgs.add("-Dwurst.test.withMods=true")
77+
programArgs.add("--username=Wurst-Bot")
78+
}
79+
}
7980
}
8081

8182
configurations {
82-
productionRuntime {
83-
extendsFrom configurations.minecraftLibraries
84-
extendsFrom configurations.loaderLibraries
85-
extendsFrom configurations.minecraftRuntimeLibraries
83+
testMods {
84+
transitive = false
8685
}
8786
}
8887

8988
dependencies {
90-
productionRuntime "net.fabricmc:fabric-loader:${project.loader_version}"
91-
productionRuntime "net.fabricmc:intermediary:${project.minecraft_version}"
89+
testMods "maven.modrinth:sodium:${project.sodium_version}"
9290
}
9391

94-
import net.fabricmc.loom.util.Platform
95-
tasks.register('runEndToEndTest', JavaExec) {
96-
dependsOn remapJar, downloadAssets
97-
classpath.from configurations.productionRuntime
98-
mainClass = "net.fabricmc.loader.impl.launch.knot.KnotClient"
99-
workingDir = file("run")
100-
101-
doFirst {
102-
classpath.from loom.minecraftProvider.minecraftClientJar
103-
workingDir.mkdirs()
104-
105-
args(
106-
"--assetIndex", loom.minecraftProvider.versionInfo.assetIndex().fabricId(loom.minecraftProvider.minecraftVersion()),
107-
"--assetsDir", new File(loom.files.userCache, "assets").absolutePath,
108-
"--gameDir", workingDir.absolutePath
109-
)
110-
111-
if (Platform.CURRENT.operatingSystem.isMacOS()) {
112-
jvmArgs("-XstartOnFirstThread")
113-
}
114-
115-
jvmArgs(
116-
"-Dfabric.addMods=${configurations.modImplementation.find { it.name.contains('fabric-api') }.absolutePath}${File.pathSeparator}${remapJar.archiveFile.get().asFile.absolutePath}",
117-
"-Dwurst.e2eTest",
118-
"-Dfabric-tag-conventions-v2.missingTagTranslationWarning=fail",
119-
"-Dfabric-tag-conventions-v1.legacyTagWarning=fail",
120-
"-Dmixin.debug.verify=true",
121-
"-Dmixin.debug.countInjections=true"
122-
)
123-
}
92+
def cleanClientGameTestWithMods = tasks.register("cleanClientGameTestWithMods", Delete) {
93+
delete layout.buildDirectory.dir("run/clientGameTestWithMods")
94+
}
95+
96+
def prepareClientGameTestWithMods = tasks.register("prepareClientGameTestWithMods", Sync) {
97+
dependsOn cleanClientGameTestWithMods
98+
from configurations.testMods
99+
into layout.buildDirectory.dir("run/clientGameTestWithMods/mods")
100+
}
101+
102+
def doModCompatTest = providers.gradleProperty("do_mod_compat_test").map { it.toBoolean() }.orElse(false)
103+
tasks.named("runClientGameTestWithMods") {
104+
onlyIf { doModCompatTest.get() }
105+
dependsOn prepareClientGameTestWithMods
124106
}
125107

126108
processResources {
@@ -168,13 +150,13 @@ spotless {
168150
eclipse().configFile(file("codestyle/formatter.xml"))
169151
}
170152
format("licenseHeader") {
171-
target("src/*/java/**/*.java", "src/test/java/**/*.java")
153+
target("src/*/java/**/*.java")
172154
def header_file = file("codestyle/license_header.txt")
173155
def delimiter = LicenseHeaderStep.DEFAULT_JAVA_HEADER_DELIMITER
174156
licenseHeaderFile(header_file, delimiter).updateYearWithLatest(true)
175157
}
176158
json {
177-
target "src/**/*.json"
159+
target("src/**/*.json", "src/**/*.mcmeta")
178160
gson().indentWithSpaces(2).version("2.11.0")
179161
}
180162
}

gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@ gh_repo_id=Wurst-Imperium/Wurst7
2525
mcx_repo_id=Wurst-Imperium/Wurst-MCX2
2626

2727
# Dependencies
28+
# check at https://modrinth.com/mod/sodium/versions?l=fabric&g=1.21.4
29+
sodium_version=mc1.21.4-0.6.13-fabric
30+
do_mod_compat_test=true

0 commit comments

Comments
 (0)