-
-
Notifications
You must be signed in to change notification settings - Fork 420
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fakeplayer-fix
- Loading branch information
Showing
10 changed files
with
251 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright (c) 2014-2024 Wurst-Imperium and contributors. | ||
* | ||
* This source code is subject to the terms of the GNU General Public | ||
* License, version 3. If a copy of the GPL was not distributed with this | ||
* file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt | ||
*/ | ||
package net.wurstclient.test; | ||
|
||
import static net.wurstclient.test.WurstClientTestHelper.*; | ||
|
||
import net.minecraft.block.Blocks; | ||
|
||
public enum AutoMineHackTest | ||
{ | ||
; | ||
|
||
public static void testAutoMineHack() | ||
{ | ||
System.out.println("Testing AutoMine hack"); | ||
runChatCommand("gamemode survival"); | ||
|
||
// Break a dirt block in survival mode | ||
runChatCommand("setblock ~ ~1 ~2 minecraft:dirt"); | ||
waitForBlock(0, 1, 2, Blocks.DIRT); | ||
runWurstCommand("t AutoMine on"); | ||
waitForBlock(0, 1, 2, Blocks.AIR); | ||
takeScreenshot("automine_survival"); | ||
|
||
// Clean up | ||
runWurstCommand("t AutoMine off"); | ||
runChatCommand("gamemode creative"); | ||
runChatCommand("kill @e[type=item]"); | ||
runChatCommand("clear"); | ||
clearChat(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Copyright (c) 2014-2024 Wurst-Imperium and contributors. | ||
* | ||
* This source code is subject to the terms of the GNU General Public | ||
* License, version 3. If a copy of the GPL was not distributed with this | ||
* file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt | ||
*/ | ||
package net.wurstclient.test; | ||
|
||
import static net.wurstclient.test.WurstClientTestHelper.*; | ||
|
||
import java.time.Duration; | ||
|
||
import net.wurstclient.mixinterface.IKeyBinding; | ||
|
||
public enum FreecamHackTest | ||
{ | ||
; | ||
|
||
public static void testFreecamHack() | ||
{ | ||
System.out.println("Testing Freecam hack"); | ||
|
||
// Enable Freecam with default settings | ||
runWurstCommand("setcheckbox Freecam tracer off"); | ||
runWurstCommand("t Freecam on"); | ||
takeScreenshot("freecam_default", Duration.ofMillis(100)); | ||
clearChat(); | ||
|
||
// Press shift to fly down a bit | ||
submitAndWait( | ||
mc -> IKeyBinding.get(mc.options.sneakKey).simulatePress(true)); | ||
waitForWorldTicks(5); | ||
submitAndWait( | ||
mc -> IKeyBinding.get(mc.options.sneakKey).simulatePress(false)); | ||
takeScreenshot("freecam_down", Duration.ofMillis(300)); | ||
clearChat(); | ||
|
||
// Tracer | ||
runWurstCommand("setcheckbox Freecam tracer on"); | ||
takeScreenshot("freecam_tracer", Duration.ofMillis(100)); | ||
clearChat(); | ||
|
||
// Clean up | ||
runWurstCommand("setcheckbox Freecam tracer off"); | ||
runWurstCommand("t Freecam off"); | ||
waitForWorldTicks(5); | ||
clearChat(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright (c) 2014-2024 Wurst-Imperium and contributors. | ||
* | ||
* This source code is subject to the terms of the GNU General Public | ||
* License, version 3. If a copy of the GPL was not distributed with this | ||
* file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt | ||
*/ | ||
package net.wurstclient.test; | ||
|
||
import static net.wurstclient.test.WurstClientTestHelper.*; | ||
|
||
import net.minecraft.block.Blocks; | ||
|
||
public enum PistonTest | ||
{ | ||
; | ||
|
||
public static void testPistonDoesntCrash() | ||
{ | ||
System.out.println( | ||
"Testing that a piston can extend and retract without crashing the game"); | ||
|
||
// Place a redstone block and piston | ||
runChatCommand("setblock ~ ~1 ~2 minecraft:piston[facing=up]"); | ||
waitForBlock(0, 1, 2, Blocks.PISTON); | ||
runChatCommand("setblock ~ ~ ~2 minecraft:redstone_block"); | ||
waitForBlock(0, 0, 2, Blocks.REDSTONE_BLOCK); | ||
takeScreenshot("piston_extending"); | ||
waitForWorldTicks(3); | ||
|
||
// Destroy the redstone block | ||
runChatCommand("setblock ~ ~ ~2 minecraft:air"); | ||
waitForBlock(0, 0, 2, Blocks.AIR); | ||
takeScreenshot("piston_retracting"); | ||
waitForWorldTicks(3); | ||
|
||
// Clean up | ||
runChatCommand("setblock ~ ~1 ~2 minecraft:air"); | ||
waitForBlock(0, 1, 2, Blocks.AIR); | ||
clearChat(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
/* | ||
* Copyright (c) 2014-2024 Wurst-Imperium and contributors. | ||
* | ||
* This source code is subject to the terms of the GNU General Public | ||
* License, version 3. If a copy of the GPL was not distributed with this | ||
* file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt | ||
*/ | ||
package net.wurstclient.test; | ||
|
||
import static net.wurstclient.test.WurstClientTestHelper.*; | ||
|
||
import java.time.Duration; | ||
|
||
public enum XRayHackTest | ||
{ | ||
; | ||
|
||
public static void testXRayHack() | ||
{ | ||
System.out.println("Testing X-Ray hack"); | ||
buildTestRig(); | ||
clearChat(); | ||
|
||
// Enable X-Ray with default settings | ||
runWurstCommand("setcheckbox X-Ray only_show_exposed off"); | ||
runWurstCommand("setslider X-Ray opacity 0"); | ||
runWurstCommand("t X-Ray on"); | ||
takeScreenshot("xray_default", Duration.ofMillis(300)); | ||
runWurstCommand("t X-Ray off"); | ||
clearChat(); | ||
|
||
// Exposed only | ||
runWurstCommand("setcheckbox X-Ray only_show_exposed on"); | ||
runWurstCommand("setslider X-Ray opacity 0"); | ||
runWurstCommand("t X-Ray on"); | ||
takeScreenshot("xray_exposed_only", Duration.ofMillis(300)); | ||
runWurstCommand("t X-Ray off"); | ||
clearChat(); | ||
|
||
// Opacity mode | ||
runWurstCommand("setcheckbox X-Ray only_show_exposed off"); | ||
runWurstCommand("setslider X-Ray opacity 0.5"); | ||
runWurstCommand("t X-Ray on"); | ||
takeScreenshot("xray_opacity", Duration.ofMillis(300)); | ||
runWurstCommand("t X-Ray off"); | ||
clearChat(); | ||
|
||
// Exposed only + opacity | ||
runWurstCommand("setcheckbox X-Ray only_show_exposed on"); | ||
runWurstCommand("setslider X-Ray opacity 0.5"); | ||
runWurstCommand("t X-Ray on"); | ||
takeScreenshot("xray_exposed_only_opacity", Duration.ofMillis(300)); | ||
runWurstCommand("t X-Ray off"); | ||
clearChat(); | ||
|
||
// Clean up | ||
runChatCommand("fill ~-7 ~ ~-7 ~7 ~30 ~7 air"); | ||
runWurstCommand("setcheckbox X-Ray only_show_exposed off"); | ||
runWurstCommand("setslider X-Ray opacity 0"); | ||
runWurstCommand("t X-Ray off"); | ||
clearChat(); | ||
} | ||
|
||
private static void buildTestRig() | ||
{ | ||
runChatCommand("fill ~-5 ~ ~5 ~5 ~5 ~7 stone"); | ||
|
||
// Hidden ores | ||
runChatCommand("setblock ~-4 ~1 ~6 minecraft:coal_ore"); | ||
runChatCommand("setblock ~-2 ~1 ~6 minecraft:iron_ore"); | ||
runChatCommand("setblock ~0 ~1 ~6 minecraft:gold_ore"); | ||
runChatCommand("setblock ~2 ~1 ~6 minecraft:diamond_ore"); | ||
runChatCommand("setblock ~4 ~1 ~6 minecraft:emerald_ore"); | ||
runChatCommand("setblock ~-4 ~3 ~6 minecraft:lapis_ore"); | ||
runChatCommand("setblock ~-2 ~3 ~6 minecraft:redstone_ore"); | ||
runChatCommand("setblock ~0 ~3 ~6 minecraft:copper_ore"); | ||
runChatCommand("setblock ~2 ~3 ~6 minecraft:nether_gold_ore"); | ||
runChatCommand("setblock ~4 ~3 ~6 minecraft:nether_quartz_ore"); | ||
|
||
// Partially exposed ores (air block in front) | ||
runChatCommand("setblock ~-4 ~1 ~5 minecraft:coal_ore"); | ||
runChatCommand("setblock ~-2 ~1 ~5 minecraft:iron_ore"); | ||
runChatCommand("setblock ~0 ~1 ~5 minecraft:gold_ore"); | ||
runChatCommand("setblock ~2 ~1 ~5 minecraft:diamond_ore"); | ||
runChatCommand("setblock ~4 ~1 ~5 minecraft:emerald_ore"); | ||
runChatCommand("setblock ~-4 ~3 ~5 minecraft:lapis_ore"); | ||
runChatCommand("setblock ~-2 ~3 ~5 minecraft:redstone_ore"); | ||
runChatCommand("setblock ~0 ~3 ~5 minecraft:copper_ore"); | ||
runChatCommand("setblock ~2 ~3 ~5 minecraft:nether_gold_ore"); | ||
runChatCommand("setblock ~4 ~3 ~5 minecraft:nether_quartz_ore"); | ||
} | ||
} |