Skip to content

Commit 144a814

Browse files
committed
Merge remote-tracking branch 'upstream/1.21.1' into 1.21.8
2 parents 5d18dcb + 3661a42 commit 144a814

File tree

223 files changed

+2792
-3175
lines changed

Some content is hidden

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

223 files changed

+2792
-3175
lines changed

.github/workflows/gradle.yml

Lines changed: 43 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -87,34 +87,57 @@ jobs:
8787
done
8888
echo "</details>" >> $GITHUB_STEP_SUMMARY
8989
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
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
9993

100-
- name: Upload screenshots
94+
- name: Upload screenshots.zip artifact
10195
uses: actions/upload-artifact@v5
10296
if: ${{ success() || failure() }}
10397
with:
10498
name: screenshots
105-
path: build/run/*/screenshots
99+
path: run/screenshots
106100
compression-level: 0
107101

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
102+
- name: Upload crash-reports.zip artifact
116103
uses: actions/upload-artifact@v5
117104
if: ${{ failure() }}
118105
with:
119106
name: crash-reports
120-
path: build/run/*/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

build.gradle

Lines changed: 35 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,6 @@ repositories {
4848
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
4949
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
5050
// for more information about repositories.
51-
exclusiveContent {
52-
forRepository {
53-
maven {
54-
name = "Modrinth"
55-
url = "https://api.modrinth.com/maven"
56-
}
57-
}
58-
filter {
59-
includeGroup "maven.modrinth"
60-
}
61-
}
6251
}
6352

6453
dependencies {
@@ -80,71 +69,53 @@ dependencies {
8069
modImplementation "com.google.code.findbugs:jsr305:3.0.2"
8170
}
8271

83-
fabricApi.configureTests {
84-
createSourceSet = true
85-
enableGameTests = false
86-
enableClientGameTests = true
87-
modId = "wurst_testmod"
88-
username = "Wurst-Bot"
89-
}
90-
9172
loom {
9273
accessWidenerPath = file("src/main/resources/wurst.accesswidener")
93-
94-
runs {
95-
clientWithMods {
96-
inherit client
97-
}
98-
99-
clientGameTestWithMods {
100-
inherit client
101-
source = sourceSets.gametest
102-
runDir = "build/run/clientGameTestWithMods"
103-
vmArgs.add("-Dfabric.client.gametest")
104-
vmArgs.add("-Dwurst.test.withMods=true")
105-
programArgs.add("--username=Wurst-Bot")
106-
}
107-
}
10874
}
10975

11076
configurations {
111-
testMods {
112-
transitive = false
77+
productionRuntime {
78+
extendsFrom configurations.minecraftLibraries
79+
extendsFrom configurations.loaderLibraries
80+
extendsFrom configurations.minecraftRuntimeLibraries
11381
}
11482
}
11583

11684
dependencies {
117-
testMods "maven.modrinth:sodium:${project.sodium_version}"
85+
productionRuntime "net.fabricmc:fabric-loader:${project.loader_version}"
86+
productionRuntime "net.fabricmc:intermediary:${project.minecraft_version}"
11887
}
11988

120-
def cleanClientWithMods = tasks.register("cleanClientWithMods", Delete) {
121-
delete "run/mods"
122-
}
123-
124-
def prepareClientWithMods = tasks.register("prepareClientWithMods", Sync) {
125-
from configurations.testMods
126-
into "run/mods"
127-
}
128-
129-
tasks.named("runClientWithMods") {
130-
dependsOn prepareClientWithMods
131-
finalizedBy cleanClientWithMods
132-
}
133-
134-
def cleanClientGameTestWithMods = tasks.register("cleanClientGameTestWithMods", Delete) {
135-
delete layout.buildDirectory.dir("run/clientGameTestWithMods")
136-
}
137-
138-
def prepareClientGameTestWithMods = tasks.register("prepareClientGameTestWithMods", Sync) {
139-
dependsOn cleanClientGameTestWithMods
140-
from configurations.testMods
141-
into layout.buildDirectory.dir("run/clientGameTestWithMods/mods")
142-
}
89+
import net.fabricmc.loom.util.Platform
90+
tasks.register('runEndToEndTest', JavaExec) {
91+
dependsOn remapJar, downloadAssets
92+
classpath.from configurations.productionRuntime
93+
mainClass = "net.fabricmc.loader.impl.launch.knot.KnotClient"
94+
workingDir = file("run")
95+
96+
doFirst {
97+
classpath.from loom.minecraftProvider.minecraftClientJar
98+
workingDir.mkdirs()
99+
100+
args(
101+
"--assetIndex", loom.minecraftProvider.versionInfo.assetIndex().fabricId(loom.minecraftProvider.minecraftVersion()),
102+
"--assetsDir", new File(loom.files.userCache, "assets").absolutePath,
103+
"--gameDir", workingDir.absolutePath
104+
)
105+
106+
if (Platform.CURRENT.operatingSystem.isMacOS()) {
107+
jvmArgs("-XstartOnFirstThread")
108+
}
143109

144-
def doModCompatTest = providers.gradleProperty("do_mod_compat_test").map { it.toBoolean() }.orElse(false)
145-
tasks.named("runClientGameTestWithMods") {
146-
onlyIf { doModCompatTest.get() }
147-
dependsOn prepareClientGameTestWithMods
110+
jvmArgs(
111+
"-Dfabric.addMods=${configurations.modImplementation.find { it.name.contains('fabric-api') }.absolutePath}${File.pathSeparator}${remapJar.archiveFile.get().asFile.absolutePath}",
112+
"-Dwurst.e2eTest",
113+
"-Dfabric-tag-conventions-v2.missingTagTranslationWarning=fail",
114+
"-Dfabric-tag-conventions-v1.legacyTagWarning=fail",
115+
"-Dmixin.debug.verify=true",
116+
"-Dmixin.debug.countInjections=true"
117+
)
118+
}
148119
}
149120

150121
processResources {

gradle.properties

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ org.gradle.user.home=D:\\GradleCacheLocal
99
# Fabric Properties
1010
# check these at https://fabricmc.net/develop/ and
1111
# https://modrinth.com/mod/fabric-api/versions
12-
minecraft_version=1.21.8
13-
yarn_mappings=1.21.8+build.1
12+
minecraft_version=1.21.1
13+
yarn_mappings=1.21.1+build.3
1414
loader_version=0.18.1
1515
loom_version=1.13-SNAPSHOT
1616

1717
# Fabric API
18-
fabric_version=0.136.1+1.21.8
18+
fabric_version=0.116.7+1.21.1
1919

2020
# Mod Properties
21-
mod_version=v7.51.2-CevAPI-MC1.21.8
21+
mod_version=v7.51.2-CevaPI-MC1.21.1
2222
maven_group=net.wurstclient
2323
archives_base_name=Wurst-Client
2424
mod_loader=Fabric
@@ -28,6 +28,3 @@ gh_repo_id=cev-api/Wurst7-CevAPI
2828
mcx_repo_id=Wurst-Imperium/Wurst-MCX2
2929

3030
# Dependencies
31-
# check at https://modrinth.com/mod/sodium/versions?l=fabric&g=1.21.8
32-
sodium_version=mc1.21.8-0.7.3-fabric
33-
do_mod_compat_test=true

gradlew

100755100644
File mode changed.

0 commit comments

Comments
 (0)