Implemented BlockFailedDispenseEvent#3205
Conversation
|
I think he meant that it shouldn't be cancellable because you didn't do stuff differently based on whether it was cancelled or not. I personally believe that this event should be cancellable and not make the click sound if it is indeed cancelled, as you said. |
| @@ -1,5 +1,6 @@ | ||
| package net.minecraft.server; | ||
|
|
||
| +import com.destroystokyo.paper.event.block.BlockFailedDispenseEvent; |
There was a problem hiding this comment.
You inline the Block import, but not this one. Same in the other file.
…atch Co-Authored-By: MiniDigger <admin@minidigger.me>
|
A cancelable event implies that the entire event can be reverted, which cannot apply to an event that is marking a failure for something to happen. Making an event like this cancelable to handle playing a sound is like saying you can make the player quit event cancelable to handle the quit message sending. I personally would prefer that we keep to the standard and have this event be non cancelable and use a field to handle playing of the sound (or even make it so we can change the sound, if it makes it more justifiable) |
|
By not letting a sound be played you effectively stop this event from doing anything. What is that if not cancelling the event? While I believe we should make the event cancellable instead of adding a method, I don't really care as long as we do get a way to stop the sound from playing. |
|
The event is for when something has already failed... Being able to cancel it makes no sense. If you want to stop the sound from playing, doing it when something is being dispensed seems like the more logical place to do that, not after it's already happened. |
|
we have another event that lets you control the effect as a result of something else, and we used a separate boolean/setter for it. That would be more clear to have event.setPlayEffect(false); and no cancellation state on the event. |
electronicboy
left a comment
There was a problem hiding this comment.
Provisionally approved, but, would be nice to see the playSound suggestion on here implemented
|
reopened in #4820 since this is bork |
This event should be fired when a block such as a Dispenser or a Dropper tries to dispense an item but it was empty. As KennyTV told me before, and as it also seems a good idea, this event should not be cancellable. The only reason someone could want is as cancellable would be to 'cancel' the 'click' noise produced by the empty dispenser/dropper being triggered.