Skip to content

Commit 1745320

Browse files
committed
Merge remote-tracking branch 'upstream'
2 parents a17af3d + 8966056 commit 1745320

47 files changed

Lines changed: 1508 additions & 570 deletions

Some content is hidden

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

.github/workflows/multi_publish.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,7 @@ jobs:
5959
needs: prepare
6060
if: ${{ !fromJson(inputs.dry_run) }}
6161
strategy:
62-
# Each job pushes an automated commit to WurstClient.net@master, so running them all in parallel
63-
# would likely cause conflicts. Also, various servers might hit rate limits if we just upload
64-
# all of the files at once.
65-
max-parallel: 1
66-
# If something goes wrong, all published files have to be manually deleted.
67-
# Best to fail as early as possible.
68-
fail-fast: true
62+
fail-fast: false
6963
matrix:
7064
branch: ${{ fromJson(needs.prepare.outputs.branches) }}
7165
steps:

CONTRIBUTING.md

Lines changed: 54 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,57 @@
1-
# Contributing Guidelines
2-
Thank you for considering to contribute! Here are some guidelines to help you get started. ![](https://img.wimods.net/github.com/Wurst-Imperium/Wurst7/CONTRIBUTING.md)
1+
# Contributing to Wurst
2+
3+
This guide exists to save both sides time. ![](https://img.wimods.net/github.com/Wurst-Imperium/Wurst7/CONTRIBUTING.md)
4+
5+
## Priorities
6+
7+
1. **Maintainers first:** architecture, gametests, release workflows, review burden.
8+
2. **Users second:** features, bugfixes, compatibility, documentation.
9+
3. **Sponsors third:** advertising, donation perks, monetization.
10+
11+
Happy maintainers ensure happy users, happy users ensure happy sponsors. In that order.
12+
13+
## Issues
14+
15+
- **Search before posting:** Both GitHub issues and [WurstForum](https://wurstforum.net/) might have a post about your bug or feature request already. Find and read that first. Remember that posting duplicates makes it harder for the next person to find the original with all the answers.
16+
17+
- **State the bug or request clearly:** For requests, explain what it is, how it works, and why it matters. For bugs, include repro steps. "idk it's weird sometimes" is not actionable.
18+
19+
- **Include the crash report file:** If the game is crashing and/or it's unclear which versions you're using, I _need_ that file to diagnose the issue. No crash? Hold down <kbd>F3</kbd> + <kbd>C</kbd> for 10 seconds to force one.
20+
- Windows: `%APPDATA%/.minecraft/crash-reports/crash-<timestamp>-client.txt`
21+
- Linux: `~/.minecraft/crash-reports/crash-<timestamp>-client.txt`
22+
- macOS: `~/Library/Application Support/minecraft/crash-reports/crash-<timestamp>-client.txt`
23+
24+
- **If you want to implement the change yourself, say so.**
325

426
## Pull Requests
527

6-
### 1. Keep Pull Requests Small and Focused
7-
- **1 PR = 1 change**: Each pull request should address a single issue or add a single feature.
8-
- **Avoid Bloat**: Aim to keep the diff small and digestible. Don't stuff PRs with unrelated changes.
9-
10-
### 2. Respect the Project's Scope and Vision
11-
- **Communicate Before Coding**: Open an issue to discuss any major changes before you start working on them. This can save you a lot of time and effort in case your idea is rejected. When in doubt, ask first.
12-
- **Avoid Breaking Changes**: When modifying existing features, it's usually better to make your changes optional. Your version may work better for you, but other people will often have different use cases that rely on the original behavior.
13-
14-
### 3. Ensure Quality and Completeness
15-
- **Finish the Code**: Submit a PR only when it's complete, tested, and ready for review. Don't use pull requests as a dumping ground for half-baked prototypes.
16-
- If you need early feedback on a larger change, clearly mark the PR as a draft. You should have already started a discussion and gotten the go-ahead for your idea at this point.
17-
- **Watch the Checks**: Make sure that all automated checks are passing and that there aren't any merge conflicts. Fix such issues before asking for a review.
18-
19-
### 4. Follow the Code Style
20-
- Run Eclipse's Clean Up and Format tools with the settings from the [codestyle folder](codestyle).
21-
- If you don't use Eclipse, you can run `./gradlew spotlessApply` instead. However, be aware that this isn't as thorough as Eclipse's tools.
22-
- For anything that these automated tools don't cover, please try to match the existing code style as closely as possible.
23-
24-
## Other Ways To Help
25-
26-
- fixing a typo
27-
- in the Wurst Client itself (look for the pen icon at the top right)
28-
- on WurstClient.net (scroll all the way down and click "edit this page")
29-
- on the Wurst Wiki (login and click "Edit this page")
30-
- improving an existing bug report
31-
- figuring out which Minecraft versions are affected by the bug
32-
- Can you figure out how to make the bug happen every time? If so, please let me know.
33-
- The ["could not reproduce"](https://github.com/Wurst-Imperium/Wurst7/labels/could%20not%20reproduce) label lists bug reports where I haven't been able to figure this out.
34-
- reporting a new dupe/exploit in Minecraft that could be added to Wurst
35-
- helping with a feature request
36-
- Can you explain how the feature works?
37-
- Can you add the feature in a Pull Request?
38-
- Do you know anything else about the feature that hasn't been mentioned?
39-
- helping with the [Wurst Wiki](https://wurst.wiki/)
40-
- translating Wurst Wiki articles to another language
41-
- adding screenshots of features where appropriate
42-
- making sure that changes from recent Wurst updates are documented
43-
- digging through old Wurst updates to find out when exactly a feature was added
44-
- helping people who can't figure out how to install Wurst
45-
- making tutorials / how-to videos
46-
- how to make [AutoBuild templates](https://wurst.wiki/autobuild#creating_templates)
47-
- how to use the [profile system](https://www.wurstclient.net/updates/wurst-7-1/)
48-
- creating more backups/archives of Wurst
49-
- [creating a fork](https://github.com/Wurst-Imperium/Wurst7/fork) / mirror of this repository
50-
- adding [WurstClient.net](https://www.wurstclient.net/) pages to the Internet Archive
51-
- adding [Wurst Wiki](https://wurst.wiki/) articles to the Internet Archive
52-
- archiving old [Wurst releases](https://www.wurstclient.net/download/) & source code in case they are ever taken down
53-
- archiving [WiZARDHAX Wurst videos](https://www.youtube.com/c/wizardhax/videos) in case the channel is ever taken down
54-
- just spreading the word, telling people about Wurst, etc.
55-
- expanding this list with more things that people can do to help (This is all I could think of for now.)
28+
- **Communicate first:** Please talk to me before opening a PR. I don't like receiving PRs out of the blue. This is supposed to be a collaborative process.
29+
30+
- **1 PR = 1 change:** Each pull request should address a single issue or add a single feature. Don't stuff PRs with unrelated changes.
31+
32+
- **Make it easy to review:** Keep the diff small and the code readable. Include any `/give` commands or whatever I need to test your change in the PR description. Remember that review is the bottleneck.
33+
34+
- **Follow the code style:** Run `./gradlew spotlessApply` or Eclipse settings from the [codestyle folder](codestyle). For anything that this doesn't cover, please try to match the existing style as closely as possible.
35+
36+
- **Run tests:** `./gradlew check runClientGameTest runClientGameTestWithMods` must pass. Consider adding a gametest for your change. It's not easy, but it helps a lot.
37+
38+
- **Sign the CLA:** <https://cla-assistant.io/Wurst-Imperium/Wurst7>. See below for why.
39+
40+
### Why we have a CLA
41+
42+
The CLA basically just restates the important bits of the GPLv3 license:
43+
44+
- Copyright exists. You can't just submit code that you don't have the rights to.
45+
- You can't request to have your PR "un-merged" later. No takesies-backsies.
46+
- Anyone can use Wurst, even if it includes your code, to do things you don't like.
47+
- Anyone can sell or make money from Wurst, even if it includes your code, without having to pay you.
48+
49+
The GPL already enforces these rules. The CLA is just there to draw attention to them, because "I didn't read the license" has happened enough times already.
50+
51+
## Wurst Wiki
52+
53+
Anyone can contribute to the wiki. You don't need permission. You only need an email address to create an account.
54+
55+
See: <https://wurst.wiki/how_to_help>
56+
57+
Note: The wiki has a Cloudflare captcha on the login/registration page to lock out spam bots. Sorry if this is blocked in your country. It's necessary.

build.gradle

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ buildscript {
66

77
plugins {
88
id "net.fabricmc.fabric-loom" version "${loom_version}"
9-
id "com.diffplug.spotless" version "8.5.1"
9+
id "com.diffplug.spotless" version "8.6.0"
10+
id "net.wimods.github-compile-summary" version "0.1.1"
1011
}
1112

1213
def ENV = System.getenv()
@@ -67,8 +68,6 @@ dependencies {
6768
// To change the versions see the gradle.properties file
6869
minecraft "com.mojang:minecraft:${project.minecraft_version}"
6970
implementation "net.fabricmc:fabric-loader:${project.loader_version}"
70-
testImplementation "org.junit.jupiter:junit-jupiter:5.13.4"
71-
testRuntimeOnly "org.junit.platform:junit-platform-launcher:1.13.4"
7271

7372
// Fabric API. This is technically optional, but you probably want it anyway.
7473
implementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"
@@ -123,10 +122,32 @@ configurations {
123122
}
124123
}
125124

125+
def optionalCompatMods = [
126+
sodium: [artifact: "sodium", property: "sodium_version"],
127+
better_block_entities: [
128+
artifact: "better-block-entities",
129+
property: "better_block_entities_version"
130+
],
131+
badoptimizations: [
132+
artifact: "badoptimizations",
133+
property: "badoptimizations_version"
134+
]
135+
]
136+
137+
def compatModVersions = optionalCompatMods.collectEntries { id, mod ->
138+
[(id): providers.gradleProperty(mod.property).orElse("")]
139+
}
140+
126141
dependencies {
127-
testMods "maven.modrinth:sodium:${project.sodium_version}"
128-
// Ensure gametest source set has Fabric JUnit engine
129-
gametestImplementation "net.fabricmc:fabric-loader-junit:${project.loader_version}"
142+
optionalCompatMods.each { id, mod ->
143+
def version = compatModVersions[id].get().trim()
144+
if(!version.isEmpty())
145+
testMods "maven.modrinth:${mod.artifact}:${version}"
146+
}
147+
}
148+
149+
def hasCompatMods = providers.provider {
150+
compatModVersions.values().any { !it.get().trim().isEmpty() }
130151
}
131152

132153
def cleanClientWithMods = tasks.register("cleanClientWithMods", Delete) {
@@ -139,6 +160,7 @@ def prepareClientWithMods = tasks.register("prepareClientWithMods", Sync) {
139160
}
140161

141162
tasks.named("runClientWithMods") {
163+
onlyIf { hasCompatMods.get() }
142164
dependsOn prepareClientWithMods
143165
finalizedBy cleanClientWithMods
144166
}
@@ -153,9 +175,8 @@ def prepareClientGameTestWithMods = tasks.register("prepareClientGameTestWithMod
153175
into layout.buildDirectory.dir("run/clientGameTestWithMods/mods")
154176
}
155177

156-
def doModCompatTest = providers.gradleProperty("do_mod_compat_test").map { it.toBoolean() }.orElse(false)
157178
tasks.named("runClientGameTestWithMods") {
158-
onlyIf { doModCompatTest.get() }
179+
onlyIf { hasCompatMods.get() }
159180
dependsOn prepareClientGameTestWithMods
160181
}
161182

@@ -285,10 +306,6 @@ spotless {
285306
}
286307
}
287308

288-
test {
289-
useJUnitPlatform()
290-
}
291-
292309
def getGhVersion() {
293310
return version.substring(0, version.indexOf("-MC"))
294311
}

gradle.properties

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ org.gradle.parallel=true
44
org.gradle.configuration-cache=true
55

66
# Fabric Properties
7-
# check these at https://fabricmc.net/develop/ and
7+
# Check these at https://fabricmc.net/develop/ and
88
# https://modrinth.com/mod/fabric-api/versions
99
minecraft_version=26.1.2
1010
loader_version=0.19.2
1111
loom_version=1.16-SNAPSHOT
1212

1313
# Fabric API
14-
fabric_api_version=0.149.1+26.1.2
14+
fabric_api_version=0.150.0+26.1.2
1515

1616
# Mod Properties
17-
mod_version=v7.53.1-CevAPI-MC26.1.2
17+
mod_version=v7.54-CevAPI-MC26.1.2
1818
fork_release_version=0.55
1919
maven_group=net.wurstclient
2020
archives_base_name=Wurst-Client
@@ -23,7 +23,12 @@ mod_loader=Fabric
2323
# GitHub
2424
gh_repo_id=cev-api/Wurst7-CevAPI
2525

26-
# Dependencies
27-
# check at https://modrinth.com/mod/sodium/versions?l=fabric&g=26.1.2
26+
# Mod versions for automated compatibility tests:
27+
# Check at https://modrinth.com/mod/sodium/versions?l=fabric&g=26.1.2
2828
sodium_version=mc26.1.2-0.8.12-fabric
29-
do_mod_compat_test=true
29+
30+
# For manual testing (uncomment as needed):
31+
# Check at https://modrinth.com/mod/better-block-entities/versions?g=26.1.2
32+
#better_block_entities_version=1.3.4+mc26.1.2
33+
# Check at https://modrinth.com/mod/badoptimizations/versions?g=26.1.2
34+
#badoptimizations_version=gjIvugXc

modrinth_deps.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"better_block_entities_version": "better-block-entities",
23
"fabric_api_version": "fabric-api",
34
"sodium_version": "sodium"
45
}

settings.gradle

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,16 @@ pluginManagement {
66
}
77
mavenCentral()
88
gradlePluginPortal()
9+
exclusiveContent {
10+
forRepository {
11+
maven {
12+
name = 'WIMods'
13+
url = 'https://maven.wimods.net/releases'
14+
}
15+
}
16+
filter {
17+
includeGroupByRegex 'net\\.wimods(\\..*)?'
18+
}
19+
}
920
}
1021
}

src/gametest/java/net/wurstclient/gametest/SingleplayerTest.java

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,19 @@ public SingleplayerTest(ClientGameTestContext context,
4646
public final void run()
4747
{
4848
runImpl();
49-
waitForScreenshotMatch(
50-
getClass().getSimpleName().toLowerCase() + "_cleanup",
51-
"https://i.imgur.com/XF1SILt.png");
49+
50+
String testName = getClass().getSimpleName();
51+
int retries =
52+
waitForScreenshotMatch(testName.toLowerCase() + "_cleanup",
53+
"https://i.imgur.com/XF1SILt.png");
54+
55+
if(retries > 0)
56+
logger.warn(testName + " needed " + retries
57+
+ " retries to get a valid cleanup screenshot. First view ALL"
58+
+ " screenshots from " + testName + " to understand what"
59+
+ " happened, then optionally retest. If this keeps happening,"
60+
+ " your timings are probably wrong. Otherwise it's likely a"
61+
+ " fluke, especially if you didn't change any gametest code.");
5262
}
5363

5464
/**
@@ -131,10 +141,10 @@ protected final void assertScreenshotEquals(String fileName,
131141
templateUrl);
132142
}
133143

134-
protected final void waitForScreenshotMatch(String fileName,
144+
protected final int waitForScreenshotMatch(String fileName,
135145
String templateUrl)
136146
{
137-
WurstClientTestHelper.waitForScreenshotMatch(context, fileName,
147+
return WurstClientTestHelper.waitForScreenshotMatch(context, fileName,
138148
templateUrl);
139149
}
140150

src/gametest/java/net/wurstclient/gametest/WurstClientTestHelper.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,19 @@ public static void assertScreenshotEquals(ClientGameTestContext context,
6666
* get the timing right. Not useful for anything that's still in motion,
6767
* where delaying the screenshot would only cause it to drift further away
6868
* from the expected image.
69+
*
70+
* @return The number of retries it took to get a matching screenshot.
6971
*/
70-
public static void waitForScreenshotMatch(ClientGameTestContext context,
72+
public static int waitForScreenshotMatch(ClientGameTestContext context,
7173
String fileName, String templateUrl)
7274
{
7375
ThreadingImpl.checkOnGametestThread("waitForScreenshotMatch");
74-
waitForScreenshotMatchImpl(context, fileName, templateUrl,
76+
return waitForScreenshotMatchImpl(context, fileName, templateUrl,
7577
ClientGameTestContext.DEFAULT_TIMEOUT);
7678
}
7779

78-
private static void waitForScreenshotMatchImpl(
79-
ClientGameTestContext context, String fileName, String templateUrl,
80-
int maxAttempts)
80+
private static int waitForScreenshotMatchImpl(ClientGameTestContext context,
81+
String fileName, String templateUrl, int maxAttempts)
8182
{
8283
NativeImage nativeImageTemplate = downloadImage(templateUrl);
8384
boolean[][] mask = alphaChannelToMask(nativeImageTemplate);
@@ -106,7 +107,7 @@ private static void waitForScreenshotMatchImpl(
106107

107108
Vector2i result = algo.findColor(maskedScreenshot, maskedTemplate);
108109
if(result != null)
109-
return;
110+
return i;
110111
}
111112

112113
ghSummary("### Screenshot " + fileName + " does not match template");

src/gametest/java/net/wurstclient/gametest/WurstTest.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import net.fabricmc.fabric.api.client.gametest.v1.context.TestSingleplayerContext;
2525
import net.fabricmc.fabric.api.client.gametest.v1.world.TestWorldBuilder;
2626
import net.fabricmc.fabric.impl.client.gametest.TestSystemProperties;
27+
import net.fabricmc.loader.api.FabricLoader;
2728
import net.minecraft.SharedConstants;
2829
import net.minecraft.client.gui.screens.worldselection.WorldCreationUiState;
2930
import net.minecraft.world.level.block.Blocks;
@@ -32,13 +33,16 @@
3233
import net.minecraft.world.level.levelgen.flat.FlatLayerInfo;
3334
import net.minecraft.world.level.levelgen.flat.FlatLevelGeneratorSettings;
3435
import net.wurstclient.gametest.tests.*;
36+
import net.wurstclient.gametest.tests.filters.FilterBabiesTest;
37+
import net.wurstclient.gametest.tests.filters.FilterPassiveWaterTest;
38+
import net.wurstclient.gametest.tests.filters.FilterPetsTest;
3539

3640
public class WurstTest implements FabricClientGameTest
3741
{
3842
public static final Logger LOGGER = LoggerFactory.getLogger("Wurst Test");
3943

40-
public static final boolean IS_MOD_COMPAT_TEST =
41-
System.getProperty("wurst.test.withMods") != null;
44+
public static final boolean IS_SODIUM_INSTALLED =
45+
FabricLoader.getInstance().isModLoaded("sodium");
4246

4347
@Override
4448
public void runTest(ClientGameTestContext context)
@@ -118,12 +122,18 @@ private void testInWorld(ClientGameTestContext context,
118122

119123
new InGameMenuTest(context, spContext).run();
120124

125+
// Test entity filters
126+
new FilterBabiesTest(context, spContext).run();
127+
new FilterPassiveWaterTest(context, spContext).run();
128+
new FilterPetsTest(context, spContext).run();
129+
121130
// TODO: Open ClickGUI and Navigator
122131

123132
// Test Wurst hacks
124133
new AutoMineHackTest(context, spContext).run();
125134
new FreecamHackTest(context, spContext).run();
126135
new NoFallHackTest(context, spContext).run();
136+
new NoShieldOverlayHackTest(context, spContext).run();
127137
new NoWeatherHackTest(context, spContext).run();
128138
new XRayHackTest(context, spContext).run();
129139

@@ -135,6 +145,7 @@ private void testInWorld(ClientGameTestContext context,
135145
// TODO: Test more Wurst features
136146

137147
// Test special cases
148+
new AttributeSwapMechanicTest(context, spContext).run();
138149
new PistonTest(context, spContext).run();
139150
}
140151

0 commit comments

Comments
 (0)