Skip to content

Commit d3c6983

Browse files
committed
Merge remote-tracking branch 'upstream'
2 parents bfdad43 + 6d1ad18 commit d3c6983

File tree

114 files changed

+1625
-766
lines changed

Some content is hidden

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

114 files changed

+1625
-766
lines changed

.github/workflows/update_modrinth_deps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
branch: ['master', '26.1']
18+
branch: ["master", "26.1", "1.21.10", "1.21.8"]
1919
steps:
2020
- name: Checkout
2121
uses: actions/checkout@v6

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Wurst Client v7.52 (MC1.21.11) - Modified by CevAPI
1+
# Wurst Client v7.53 (MC1.21.11) - Modified by CevAPI
22

33
![CevAPI Logo](https://i.imgur.com/kBIn9Ab.png)
44

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ buildscript {
66

77
plugins {
88
id "fabric-loom" version "${loom_version}"
9-
id "com.diffplug.spotless" version "8.3.0"
9+
id "com.diffplug.spotless" version "8.4.0"
1010
}
1111

1212
def ENV = System.getenv()

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ loom_version=1.14-SNAPSHOT
1515
fabric_api_version=0.140.2+1.21.11
1616

1717
# Mod Properties
18-
mod_version=v7.52-CevAPI-MC1.21.11
19-
fork_release_version=0.47
18+
mod_version=v7.53-CevAPI-MC1.21.11
19+
fork_release_version=0.48
2020
maven_group=net.wurstclient
2121
archives_base_name=Wurst-Client
2222
mod_loader=Fabric

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
/*
2+
* Copyright (c) 2014-2026 Wurst-Imperium and contributors.
3+
*
4+
* This source code is subject to the terms of the GNU General Public
5+
* License, version 3. If a copy of the GPL was not distributed with this
6+
* file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt
7+
*/
8+
package net.wurstclient.gametest;
9+
10+
import java.nio.file.Path;
11+
12+
import org.lwjgl.glfw.GLFW;
13+
import org.slf4j.Logger;
14+
15+
import net.fabricmc.fabric.api.client.gametest.v1.TestInput;
16+
import net.fabricmc.fabric.api.client.gametest.v1.context.ClientGameTestContext;
17+
import net.fabricmc.fabric.api.client.gametest.v1.context.TestClientWorldContext;
18+
import net.fabricmc.fabric.api.client.gametest.v1.context.TestServerContext;
19+
import net.fabricmc.fabric.api.client.gametest.v1.context.TestSingleplayerContext;
20+
import net.minecraft.world.item.Item;
21+
import net.minecraft.world.item.ItemStack;
22+
import net.minecraft.world.level.block.Block;
23+
24+
public abstract class SingleplayerTest
25+
{
26+
protected final ClientGameTestContext context;
27+
protected final TestSingleplayerContext spContext;
28+
protected final TestInput input;
29+
protected final TestClientWorldContext world;
30+
protected final TestServerContext server;
31+
protected final Logger logger = WurstTest.LOGGER;
32+
33+
public SingleplayerTest(ClientGameTestContext context,
34+
TestSingleplayerContext spContext)
35+
{
36+
this.context = context;
37+
this.spContext = spContext;
38+
this.input = context.getInput();
39+
this.world = spContext.getClientWorld();
40+
this.server = spContext.getServer();
41+
}
42+
43+
/**
44+
* Runs the test and verifies cleanup afterward.
45+
*/
46+
public final void run()
47+
{
48+
runImpl();
49+
assertScreenshotEquals(
50+
getClass().getSimpleName().toLowerCase() + "_cleanup",
51+
"https://i.imgur.com/i2Nr9is.png");
52+
}
53+
54+
/**
55+
* Implement the actual test logic here. The test is responsible for
56+
* cleaning up after itself (disabling hacks, removing blocks, clearing
57+
* chat/inventory/particles, etc.).
58+
*/
59+
protected abstract void runImpl();
60+
61+
protected final void runCommand(String command)
62+
{
63+
WurstClientTestHelper.runCommand(server, command);
64+
}
65+
66+
protected final void runWurstCommand(String command)
67+
{
68+
WurstClientTestHelper.runWurstCommand(context, command);
69+
}
70+
71+
protected final void waitForBlock(int relX, int relY, int relZ, Block block)
72+
{
73+
context.waitFor(mc -> mc.level
74+
.getBlockState(mc.player.blockPosition().offset(relX, relY, relZ))
75+
.getBlock() == block);
76+
}
77+
78+
/**
79+
* Waits for the hand swing and equip animations to finish. Call this
80+
* after any action that changes/clears the currently held item, if a
81+
* screenshot is taken soon after (<1 second).
82+
*/
83+
protected final void waitForHandSwing()
84+
{
85+
context.waitFor(mc -> {
86+
var renderer =
87+
mc.getEntityRenderDispatcher().getItemInHandRenderer();
88+
return !mc.player.swinging && renderer.mainHandHeight == 1
89+
&& renderer.oMainHandHeight == 1;
90+
}, 20);
91+
}
92+
93+
protected final void clearChat()
94+
{
95+
context.runOnClient(mc -> mc.gui.getChat().clearMessages(true));
96+
}
97+
98+
protected final void clearInventory()
99+
{
100+
input.pressKey(GLFW.GLFW_KEY_T);
101+
input.typeChars("/clear");
102+
input.pressKey(GLFW.GLFW_KEY_ENTER);
103+
}
104+
105+
protected final void clearParticles()
106+
{
107+
context.runOnClient(mc -> mc.particleEngine.clearParticles());
108+
}
109+
110+
protected final void clearToasts()
111+
{
112+
context.runOnClient(mc -> mc.getToastManager().clear());
113+
}
114+
115+
protected final void assertOneItemInSlot(int slot, Item item)
116+
{
117+
ItemStack stack = context
118+
.computeOnClient(mc -> mc.player.getInventory().getItem(slot));
119+
if(!stack.is(item) || stack.getCount() != 1)
120+
throw new RuntimeException(
121+
"Expected 1 " + item.getName().getString() + " at slot " + slot
122+
+ ", found " + stack.getCount() + " "
123+
+ stack.getItem().getName().getString() + " instead");
124+
}
125+
126+
protected final void assertScreenshotEquals(String fileName,
127+
String templateUrl)
128+
{
129+
WurstClientTestHelper.assertScreenshotEquals(context, fileName,
130+
templateUrl);
131+
}
132+
133+
protected final void failWithScreenshot(String fileName, String title,
134+
String errorMessage)
135+
{
136+
Path screenshotPath = context.takeScreenshot(fileName);
137+
138+
WurstClientTestHelper
139+
.ghSummary("### " + title + "\n" + errorMessage + "\n");
140+
String url = WurstClientTestHelper.tryUploadToImgur(screenshotPath);
141+
if(url != null)
142+
WurstClientTestHelper.ghSummary("![" + fileName + "](" + url + ")");
143+
else
144+
WurstClientTestHelper.ghSummary("Couldn't upload " + fileName
145+
+ ".png to Imgur. Check the Test Screenshots.zip artifact.");
146+
147+
throw new RuntimeException(title + ": " + errorMessage);
148+
}
149+
150+
protected final void assertNoItemInSlot(int slot)
151+
{
152+
ItemStack stack = context
153+
.computeOnClient(mc -> mc.player.getInventory().getItem(slot));
154+
if(!stack.isEmpty())
155+
throw new RuntimeException("Expected no item in slot " + slot
156+
+ ", found " + stack.getCount() + " "
157+
+ stack.getItem().getName().getString() + " instead");
158+
}
159+
}

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

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@
3636
import net.fabricmc.fabric.impl.client.gametest.threading.ThreadingImpl;
3737
import net.minecraft.client.gui.screens.TitleScreen;
3838
import net.minecraft.commands.CommandSourceStack;
39-
import net.minecraft.world.item.Item;
40-
import net.minecraft.world.item.ItemStack;
41-
import net.minecraft.world.level.block.Block;
4239

4340
public enum WurstClientTestHelper
4441
{
@@ -284,57 +281,4 @@ public static String tryUploadToImgur(Path imagePath)
284281
}
285282
}
286283

287-
public static void waitForBlock(ClientGameTestContext context, int relX,
288-
int relY, int relZ, Block block)
289-
{
290-
context.waitFor(mc -> mc.level
291-
.getBlockState(mc.player.blockPosition().offset(relX, relY, relZ))
292-
.getBlock() == block);
293-
}
294-
295-
public static void clearChat(ClientGameTestContext context)
296-
{
297-
context.runOnClient(mc -> mc.gui.getChat().clearMessages(true));
298-
}
299-
300-
public static void clearInventory(ClientGameTestContext context)
301-
{
302-
TestInput input = context.getInput();
303-
input.pressKey(GLFW.GLFW_KEY_T);
304-
input.typeChars("/clear");
305-
input.pressKey(GLFW.GLFW_KEY_ENTER);
306-
}
307-
308-
public static void clearParticles(ClientGameTestContext context)
309-
{
310-
context.runOnClient(mc -> mc.particleEngine.clearParticles());
311-
}
312-
313-
public static void clearToasts(ClientGameTestContext context)
314-
{
315-
context.runOnClient(mc -> mc.getToastManager().clear());
316-
}
317-
318-
public static void assertOneItemInSlot(ClientGameTestContext context,
319-
int slot, Item item)
320-
{
321-
ItemStack stack = context
322-
.computeOnClient(mc -> mc.player.getInventory().getItem(slot));
323-
if(!stack.is(item) || stack.getCount() != 1)
324-
throw new RuntimeException(
325-
"Expected 1 " + item.getName().getString() + " at slot " + slot
326-
+ ", found " + stack.getCount() + " "
327-
+ stack.getItem().getName().getString() + " instead");
328-
}
329-
330-
public static void assertNoItemInSlot(ClientGameTestContext context,
331-
int slot)
332-
{
333-
ItemStack stack = context
334-
.computeOnClient(mc -> mc.player.getInventory().getItem(slot));
335-
if(!stack.isEmpty())
336-
throw new RuntimeException("Expected no item in slot " + slot
337-
+ ", found " + stack.getCount() + " "
338-
+ stack.getItem().getName().getString() + " instead");
339-
}
340284
}

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -116,26 +116,26 @@ private void testInWorld(ClientGameTestContext context,
116116
"setmode WurstLogo visibility only_when_outdated");
117117
runWurstCommand(context, "setcheckbox HackList animations off");
118118

119-
InGameMenuTest.testMenuScreens(context);
119+
new InGameMenuTest(context, spContext).run();
120120

121121
// TODO: Open ClickGUI and Navigator
122122

123123
// Test Wurst hacks
124-
AutoMineHackTest.testAutoMineHack(context, spContext);
125-
FreecamHackTest.testFreecamHack(context, spContext);
126-
NoFallHackTest.testNoFallHack(context, spContext);
127-
NoWeatherHackTest.testNoWeatherHack(context, spContext);
128-
XRayHackTest.testXRayHack(context, spContext);
124+
new AutoMineHackTest(context, spContext).run();
125+
new FreecamHackTest(context, spContext).run();
126+
new NoFallHackTest(context, spContext).run();
127+
new NoWeatherHackTest(context, spContext).run();
128+
new XRayHackTest(context, spContext).run();
129129

130130
// Test Wurst commands
131-
CopyItemCmdTest.testCopyItemCmd(context, spContext);
132-
GiveCmdTest.testGiveCmd(context, spContext);
133-
ModifyCmdTest.testModifyCmd(context, spContext);
131+
new CopyItemCmdTest(context, spContext).run();
132+
new GiveCmdTest(context, spContext).run();
133+
new ModifyCmdTest(context, spContext).run();
134134

135135
// TODO: Test more Wurst features
136136

137137
// Test special cases
138-
PistonTest.testPistonDoesntCrash(context, spContext);
138+
new PistonTest(context, spContext).run();
139139
}
140140

141141
// because the grass texture is randomized and smooth stone isn't

src/gametest/java/net/wurstclient/gametest/mixin/ScreenMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public abstract class ScreenMixin extends AbstractContainerEventHandler
3131
* Replaces the panorama background with a gray background to make test
3232
* screenshots consistent.
3333
*/
34-
@Inject(at = @At("HEAD"), method = "renderPanorama", cancellable = true)
34+
@Inject(method = "renderPanorama", at = @At("HEAD"), cancellable = true)
3535
public void renderPanoramaBackground(GuiGraphics context, float deltaTicks,
3636
CallbackInfo ci)
3737
{

0 commit comments

Comments
 (0)