You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Event listeners ordinarily do not receive cancelled events. However, they can specifically opt-in to receiving cancelled events through either the receiveCanceled parameter of the IEventBus#addListener methods or the receiveCanceled field of the @SubscribeEvent annotation.
However, code investigation and testing (prompted by @PlatinPython, thanks btw) shows that the receiveCanceled field of the @SubscribeEvent annotation is not respected, thus causing cancelled events to never reach such an annotated listener. (The addListener methods are unaffected as far as I can tell.)
Sample output from the code below:
Sending non-canceled event
StaticListener: Received event; canceled: false
InstanceListener: Received event; canceled: false
Sending canceled event
Event listeners ordinarily do not receive cancelled events. However, they can specifically opt-in to receiving cancelled events through either the
receiveCanceled
parameter of theIEventBus#addListener
methods or thereceiveCanceled
field of the@SubscribeEvent
annotation.However, code investigation and testing (prompted by @PlatinPython, thanks btw) shows that the
receiveCanceled
field of the@SubscribeEvent
annotation is not respected, thus causing cancelled events to never reach such an annotated listener. (TheaddListener
methods are unaffected as far as I can tell.)Sample output from the code below:
Sample code:
The text was updated successfully, but these errors were encountered: