mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-01 14:07:43 +01:00
callCancellable style
Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
parent
9f1fcd89ef
commit
19bb23fe3d
@ -213,7 +213,7 @@ public sealed interface EventNode<T extends Event> permits EventNodeImpl {
|
|||||||
*/
|
*/
|
||||||
default void callCancellable(@NotNull T event, @NotNull Runnable successCallback) {
|
default void callCancellable(@NotNull T event, @NotNull Runnable successCallback) {
|
||||||
call(event);
|
call(event);
|
||||||
if (!(event instanceof CancellableEvent) || !((CancellableEvent) event).isCancelled()) {
|
if (!(event instanceof CancellableEvent cancellableEvent) || !cancellableEvent.isCancelled()) {
|
||||||
successCallback.run();
|
successCallback.run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user