Skip to content

Fix BlockDispenseEvent being called when nothing actually happens#8657

Closed
Machine-Maker wants to merge 2 commits into
PaperMC:masterfrom
Machine-Maker:fix/bad-dispense-events
Closed

Fix BlockDispenseEvent being called when nothing actually happens#8657
Machine-Maker wants to merge 2 commits into
PaperMC:masterfrom
Machine-Maker:fix/bad-dispense-events

Conversation

@Machine-Maker
Copy link
Copy Markdown
Member

The BlockDispenseEvent was incorrectly called in two specific situations, when bonemealing an invalid location, like a solid block or when trying to use flint & steel in an incorrect way. This doesn't match up with the rest of the calls of BlockDispenseEvent in which something always happens, and in other cases where something might happen, that logic is checked before calling the event.

@Machine-Maker Machine-Maker requested a review from a team as a code owner December 12, 2022 18:04
@Machine-Maker Machine-Maker force-pushed the fix/bad-dispense-events branch from e8cf7ff to ae03209 Compare December 30, 2023 05:50
@Machine-Maker
Copy link
Copy Markdown
Member Author

Rebased for 1.20.4

Something that probably needs to be worked out is when exactly BlockDispenseEvent should be fired for a "failed dispense". A lot of items fallback to just being spit out if their "special action" fails, like glowstone being dispensed but the block in front isn't a respawn anchor. In this situation, dispenser with glowstone inside pointing at a non-respawn anchor block, the glowstone will be spat out. But if the block in front is a full respawn anchor, the dispense will "fail", not spitting out glowstone or refilling the anchor. Does BlockDispenseEvent fire in that case? Nothing happened, nothing changed, no item ejected, nothing. Unsure.

@Warriorrrr Warriorrrr moved this from Awaiting review to Waiting For Author in Paper PR Queue Mar 5, 2025
@kennytv kennytv added the pre-softspoon: never rebased Pre-hardfork pull requests that were not re-opened with the new main branch label Mar 23, 2025
@kennytv kennytv deleted the branch PaperMC:master March 23, 2025 19:15
@kennytv kennytv closed this Mar 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pre-softspoon: never rebased Pre-hardfork pull requests that were not re-opened with the new main branch pre-softspoon

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants