Skip to content

Commit

Permalink
Add another test element (clicking an empty slot)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhyces committed Aug 14, 2024
1 parent 2472b09 commit 56fe79c
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
}
Expand Down

0 comments on commit 56fe79c

Please sign in to comment.