From b5338abcad358406a18c6d03121c5cd4d18c45c6 Mon Sep 17 00:00:00 2001 From: zaaarf Date: Wed, 23 Aug 2023 13:06:33 +0200 Subject: feat: added support for un-canceling within a same listener --- src/main/java/ftbsc/geb/api/IEventCancelable.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/main/java/ftbsc/geb/api/IEventCancelable.java b/src/main/java/ftbsc/geb/api/IEventCancelable.java index 32669f2..c6630a1 100644 --- a/src/main/java/ftbsc/geb/api/IEventCancelable.java +++ b/src/main/java/ftbsc/geb/api/IEventCancelable.java @@ -15,8 +15,17 @@ public interface IEventCancelable extends IEvent { } /** - * Cancels the event. Any user-defined implementation will - * be ignored. + * Cancels the event. + * Any user-defined implementation will be ignored. */ - default void setCanceled() {} + default void setCanceled() { + this.setCanceled(true); + } + + /** + * Cancels the event. + * Any user-defined implementation will be ignored. + * @param canceled whether the event should be set to canceled + */ + default void setCanceled(boolean canceled) {} } -- cgit v1.2.3-56-ga3b1