From df2a4c7d42677ca8cc93e8771b2e57997daf9d7b Mon Sep 17 00:00:00 2001 From: dhyces <10985914+dhyces@users.noreply.github.com> Date: Wed, 14 Aug 2024 10:25:41 -0700 Subject: [PATCH] Add another test element (clicking an empty slot) --- .../neoforge/debug/crafting/CraftingEventTests.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/src/main/java/net/neoforged/neoforge/debug/crafting/CraftingEventTests.java b/tests/src/main/java/net/neoforged/neoforge/debug/crafting/CraftingEventTests.java index 50bba2ac2e5..d33eb4eb728 100644 --- a/tests/src/main/java/net/neoforged/neoforge/debug/crafting/CraftingEventTests.java +++ b/tests/src/main/java/net/neoforged/neoforge/debug/crafting/CraftingEventTests.java @@ -47,10 +47,14 @@ static void itemSmeltedEventTest(final DynamicTest test) { player.openMenu(be); // Test that right-clicking half of the stack out of the FurnaceResultSlot functions as expected player.containerMenu.clicked(2, InputConstants.MOUSE_BUTTON_RIGHT, ClickType.PICKUP, player); + helper.assertTrue(timesFired.getPlain() == 1, "Event was not fired the expected number of times for right-click pickup. Fired: " + timesFired.getPlain()); player.containerMenu.setCarried(ItemStack.EMPTY); // Test that shift-left-clicking the rest of the stack out works (should only fire once, not twice) player.containerMenu.clicked(2, InputConstants.MOUSE_BUTTON_LEFT, ClickType.QUICK_MOVE, player); - helper.assertTrue(timesFired.getPlain() == 2, "Event was not fired the expected number of times. Fired: " + timesFired.getPlain()); + helper.assertTrue(timesFired.getPlain() == 2, "Event was not fired the expected number of times for shift-left-click quick-move. Fired: " + timesFired.getPlain()); + // The slot is now empty, this should not fire the event + player.containerMenu.clicked(2, InputConstants.MOUSE_BUTTON_LEFT, ClickType.QUICK_MOVE, player); + helper.assertTrue(timesFired.getPlain() == 2, "Event fired for an empty slot, which should not happen."); helper.succeed(); }); }