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 Oct 22, 2024
1 parent 9df95bc commit df2a4c7
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 df2a4c7

Please sign in to comment.