Skip to content

Commit e56a6de

Browse files
Merge branch 'master' into 1.21.10
2 parents a35dcea + ac7e8f0 commit e56a6de

File tree

523 files changed

+9202
-8897
lines changed

Some content is hidden

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

523 files changed

+9202
-8897
lines changed

.github/workflows/auto_snapshot_update.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,14 @@ jobs:
6161

6262
- name: Migrate mappings
6363
run: |
64-
./gradlew migrateMappings --mappings ${{ inputs.yarn_mappings }} --overrideInputsIHaveABackup
65-
./gradlew migrateTestMappings --mappings ${{ inputs.yarn_mappings }} --overrideInputsIHaveABackup
66-
./gradlew migrateClassTweakerMappings --mappings ${{ inputs.yarn_mappings }} --overrideInputsIHaveABackup
64+
./gradlew migrateMappings --mappings "net.minecraft:mappings:${{ inputs.mc_version }}" --overrideInputsIHaveABackup
65+
./gradlew migrateGametestMappings --mappings "net.minecraft:mappings:${{ inputs.mc_version }}" --overrideInputsIHaveABackup
66+
./gradlew migrateClassTweakerMappings --mappings "net.minecraft:mappings:${{ inputs.mc_version }}" --overrideInputsIHaveABackup
6767
6868
- name: Update version constants
6969
run: |
7070
python scripts/update_version_constants.py \
7171
"${{ inputs.mc_version }}" \
72-
"${{ inputs.yarn_mappings }}" \
7372
"${{ inputs.fabric_loader }}" \
7473
"${{ inputs.fapi_version }}"
7574

.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: 49 additions & 63 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,30 +24,23 @@ 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.118.Final, used by Minecraft 1.21.5 - 1.21.10, is vulnerable to CVE-2025-58057
48-
force "io.netty:netty-codec:4.1.125.Final"
49-
// v4.1.118.Final, used by Minecraft 1.21.5 - 1.21.10, is vulnerable to CVE-2025-58056
50-
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+
}
5137
}
5238
}
5339

5440
dependencies {
5541
// To change the versions see the gradle.properties file
5642
minecraft "com.mojang:minecraft:${project.minecraft_version}"
57-
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
43+
mappings loom.officialMojangMappings()
5844
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
5945
testImplementation "net.fabricmc:fabric-loader-junit:${project.loader_version}"
6046

@@ -70,53 +56,53 @@ dependencies {
7056
modImplementation "com.google.code.findbugs:jsr305:3.0.2"
7157
}
7258

59+
fabricApi.configureTests {
60+
createSourceSet = true
61+
enableGameTests = false
62+
enableClientGameTests = true
63+
modId = "wurst_testmod"
64+
username = "Wurst-Bot"
65+
}
66+
7367
loom {
7468
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+
}
7580
}
7681

7782
configurations {
78-
productionRuntime {
79-
extendsFrom configurations.minecraftLibraries
80-
extendsFrom configurations.loaderLibraries
81-
extendsFrom configurations.minecraftRuntimeLibraries
83+
testMods {
84+
transitive = false
8285
}
8386
}
8487

8588
dependencies {
86-
productionRuntime "net.fabricmc:fabric-loader:${project.loader_version}"
87-
productionRuntime "net.fabricmc:intermediary:${project.minecraft_version}"
89+
testMods "maven.modrinth:sodium:${project.sodium_version}"
8890
}
8991

90-
import net.fabricmc.loom.util.Platform
91-
tasks.register('runEndToEndTest', JavaExec) {
92-
dependsOn remapJar, downloadAssets
93-
classpath.from configurations.productionRuntime
94-
mainClass = "net.fabricmc.loader.impl.launch.knot.KnotClient"
95-
workingDir = file("run")
96-
97-
doFirst {
98-
classpath.from loom.minecraftProvider.minecraftClientJar
99-
workingDir.mkdirs()
100-
101-
args(
102-
"--assetIndex", loom.minecraftProvider.versionInfo.assetIndex().fabricId(loom.minecraftProvider.minecraftVersion()),
103-
"--assetsDir", new File(loom.files.userCache, "assets").absolutePath,
104-
"--gameDir", workingDir.absolutePath
105-
)
106-
107-
if (Platform.CURRENT.operatingSystem.isMacOS()) {
108-
jvmArgs("-XstartOnFirstThread")
109-
}
110-
111-
jvmArgs(
112-
"-Dfabric.addMods=${configurations.modImplementation.find { it.name.contains('fabric-api') }.absolutePath}${File.pathSeparator}${remapJar.archiveFile.get().asFile.absolutePath}",
113-
"-Dwurst.e2eTest",
114-
"-Dfabric-tag-conventions-v2.missingTagTranslationWarning=fail",
115-
"-Dfabric-tag-conventions-v1.legacyTagWarning=fail",
116-
"-Dmixin.debug.verify=true",
117-
"-Dmixin.debug.countInjections=true"
118-
)
119-
}
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
120106
}
121107

122108
processResources {
@@ -164,13 +150,13 @@ spotless {
164150
eclipse().configFile(file("codestyle/formatter.xml"))
165151
}
166152
format("licenseHeader") {
167-
target("src/*/java/**/*.java", "src/test/java/**/*.java")
153+
target("src/*/java/**/*.java")
168154
def header_file = file("codestyle/license_header.txt")
169155
def delimiter = LicenseHeaderStep.DEFAULT_JAVA_HEADER_DELIMITER
170156
licenseHeaderFile(header_file, delimiter).updateYearWithLatest(true)
171157
}
172158
json {
173-
target "src/**/*.json"
159+
target("src/**/*.json", "src/**/*.mcmeta")
174160
gson().indentWithSpaces(2).version("2.11.0")
175161
}
176162
}

gradle.properties

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,30 @@
1-
# Done to increase the memory available to gradle.
2-
org.gradle.jvmargs=-Xmx2G
3-
org.gradle.parallel=true
4-
org.gradle.configuration-cache=true
5-
6-
# Fabric Properties
7-
# check these at https://fabricmc.net/develop/ and
8-
# https://modrinth.com/mod/fabric-api/versions
9-
minecraft_version=1.21.10
10-
yarn_mappings=1.21.10+build.2
11-
loader_version=0.17.3
12-
loom_version=1.13-SNAPSHOT
13-
14-
# Fabric API
15-
fabric_version=0.138.0+1.21.10
16-
17-
# Mod Properties
18-
mod_version=v7.51-MC1.21.10
19-
maven_group=net.wurstclient
20-
archives_base_name=Wurst-Client
21-
mod_loader=Fabric
22-
23-
# GitHub
24-
gh_repo_id=Wurst-Imperium/Wurst7
25-
mcx_repo_id=Wurst-Imperium/Wurst-MCX2
26-
27-
# Dependencies
1+
# Done to increase the memory available to gradle.
2+
org.gradle.jvmargs=-Xmx2G
3+
org.gradle.parallel=true
4+
org.gradle.configuration-cache=true
5+
6+
# Fabric Properties
7+
# check these at https://fabricmc.net/develop/ and
8+
# https://modrinth.com/mod/fabric-api/versions
9+
minecraft_version=1.21.10
10+
yarn_mappings=1.21.10+build.2
11+
loader_version=0.17.3
12+
loom_version=1.13-SNAPSHOT
13+
14+
# Fabric API
15+
fabric_version=0.138.3+1.21.10
16+
17+
# Mod Properties
18+
mod_version=v7.51.1-MC1.21.10
19+
maven_group=net.wurstclient
20+
archives_base_name=Wurst-Client
21+
mod_loader=Fabric
22+
23+
# GitHub
24+
gh_repo_id=Wurst-Imperium/Wurst7
25+
mcx_repo_id=Wurst-Imperium/Wurst-MCX2
26+
27+
# Dependencies
28+
# check at https://modrinth.com/mod/sodium/versions?l=fabric&g=1.21.10
29+
sodium_version=mc1.21.10-0.7.2-fabric
30+
do_mod_compat_test=true

scripts/update_version_constants.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import re
33

44

5-
def update_gradle_properties(mc_version, yarn_mappings, fabric_loader, fapi_version):
5+
def update_gradle_properties(mc_version, fabric_loader, fapi_version):
66
print("Updating gradle.properties...")
77

88
# Read gradle.properties
@@ -12,7 +12,6 @@ def update_gradle_properties(mc_version, yarn_mappings, fabric_loader, fapi_vers
1212
# Define replacements
1313
replacements = {
1414
"minecraft_version": lambda v: mc_version,
15-
"yarn_mappings": lambda v: yarn_mappings,
1615
"loader_version": lambda v: fabric_loader,
1716
"fabric_version": lambda v: fapi_version,
1817
"mod_version": lambda v: v[: v.index("MC") + 2] + mc_version,
@@ -70,14 +69,12 @@ def update_mc_version_constant(mc_version):
7069
if __name__ == "__main__":
7170
parser = argparse.ArgumentParser()
7271
parser.add_argument("mc_version", help="Minecraft version")
73-
parser.add_argument("yarn_mappings", help="Yarn mappings version")
7472
parser.add_argument("fabric_loader", help="Fabric Loader version")
7573
parser.add_argument("fapi_version", help="Fabric API version")
7674
args = parser.parse_args()
7775

7876
update_gradle_properties(
7977
args.mc_version,
80-
args.yarn_mappings,
8178
args.fabric_loader,
8279
args.fapi_version,
8380
)

0 commit comments

Comments
 (0)