Skip to content

Commit

Permalink
Adjust PistonTest timings
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander01998 committed Dec 29, 2024
1 parent 81582f0 commit 1acb31c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/main/java/net/wurstclient/test/PistonTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

import static net.wurstclient.test.WurstClientTestHelper.*;

import java.time.Duration;

import net.minecraft.block.Blocks;

public enum PistonTest
Expand All @@ -21,17 +23,17 @@ public static void testPistonDoesntCrash()
"Testing that a piston can extend and retract without crashing the game");

// Place a redstone block and piston
runChatCommand("setblock ~ ~ ~2 minecraft:redstone_block");
runChatCommand("setblock ~ ~1 ~2 minecraft:piston[facing=up]");
waitForBlock(0, 0, 2, Blocks.REDSTONE_BLOCK);
waitForBlock(0, 1, 2, Blocks.PISTON);
takeScreenshot("piston_extending");
runChatCommand("setblock ~ ~ ~2 minecraft:redstone_block");
waitForBlock(0, 0, 2, Blocks.REDSTONE_BLOCK);
takeScreenshot("piston_extending", Duration.ZERO);
waitForWorldTicks(3);

// Destroy the redstone block
runChatCommand("setblock ~ ~ ~2 minecraft:air");
waitForBlock(0, 0, 2, Blocks.AIR);
takeScreenshot("piston_retracting");
takeScreenshot("piston_retracting", Duration.ZERO);
waitForWorldTicks(3);

// Clean up
Expand Down

0 comments on commit 1acb31c

Please sign in to comment.