Skip to content

Commit 192c16f

Browse files
committed
Added cancelling check and change async events to finished
1 parent 93c5a86 commit 192c16f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public void onListenYourFavoriteEvent(YourFavoriteEvent event) {
164164

165165
## Future Plans 🛌
166166

167-
- [ ] Asynchronous events
167+
- [x] Asynchronous events
168168
- [x] Event cancellation
169169
- [x] Event listener registration
170170
- [x] Event listener deregistration

src/main/java/at/jkvn/eventlib/EventLib.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ private static void invokeMethods(List<Method> methods, Event event) {
6060
return priority != null ? priority.value().ordinal() : EventPriority.NORMAL.ordinal();
6161
}))
6262
.forEach(method -> {
63-
invokeSafely(method, event);
63+
if (!event.isCancelled()) {
64+
invokeSafely(method, event);
65+
}
6466
});
6567
}
6668

0 commit comments

Comments
 (0)