[1.21.3] Add remove count context to ItemSmeltedEvent
and fix firing multiple times with shift-click
#1440
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #1367.
This PR does two different things in regard to the event.
removeCount
and passes it as an integer field for context on how much of the item stack was removed, since the item stack given in the event is only representative of the stack that was present in the slot before splitting it.removeCount
is not zero. This is becauseAbstractFurnaceMenu#quickMoveStack
callsSlot#onTake
for the result slot while also earlier callingSlot#onQuickCraft
.FurnaceResultSlot
callscheckTakeAchievements
for bothonTake
andonQuickCraft
, which would fire the event twice.This is up for review now, though it should be merged during the next BC window due to mods with custom furnaces/machines more than likely calling the event hook themselves.