diff --git a/src/main/java/net/wurstclient/test/CopyItemCmdTest.java b/src/main/java/net/wurstclient/test/CopyItemCmdTest.java index ab966f4b16..3467882ba3 100644 --- a/src/main/java/net/wurstclient/test/CopyItemCmdTest.java +++ b/src/main/java/net/wurstclient/test/CopyItemCmdTest.java @@ -19,16 +19,18 @@ public enum CopyItemCmdTest public static void testCopyItemCmd() { System.out.println("Testing .copyitem command"); + setPerspective(Perspective.THIRD_PERSON_FRONT); // Put on a golden helmet runChatCommand("give @s golden_helmet"); rightClickInGame(); assertOneItemInSlot(39, Items.GOLDEN_HELMET); + assertNoItemInSlot(0); + takeScreenshot("copyitem_command_setup"); // .copyitem the helmet String playerName = submitAndGet(mc -> mc.player.getName().getString()); runWurstCommand("copyitem " + playerName + " head"); - setPerspective(Perspective.THIRD_PERSON_FRONT); takeScreenshot("copyitem_command_result"); assertOneItemInSlot(0, Items.GOLDEN_HELMET); diff --git a/src/main/java/net/wurstclient/test/WurstClientTestHelper.java b/src/main/java/net/wurstclient/test/WurstClientTestHelper.java index 5491712f99..548ba797d3 100644 --- a/src/main/java/net/wurstclient/test/WurstClientTestHelper.java +++ b/src/main/java/net/wurstclient/test/WurstClientTestHelper.java @@ -413,4 +413,15 @@ public static void assertOneItemInSlot(int slot, Item item) + stack.getItem().getName().getString() + " instead"); }); } + + public static void assertNoItemInSlot(int slot) + { + submitAndWait(mc -> { + ItemStack stack = mc.player.getInventory().getStack(slot); + if(!stack.isEmpty()) + throw new RuntimeException("Expected no item in slot " + slot + + ", found " + stack.getCount() + " " + + stack.getItem().getName().getString() + " instead"); + }); + } }