mirror of
https://github.com/Minestom/Minestom.git
synced 2024-12-29 12:37:42 +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) {
|
||||
call(event);
|
||||
if (!(event instanceof CancellableEvent) || !((CancellableEvent) event).isCancelled()) {
|
||||
if (!(event instanceof CancellableEvent cancellableEvent) || !cancellableEvent.isCancelled()) {
|
||||
successCallback.run();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user