Skip to content

Commit

Permalink
Fix ClassCastException in EventListener
Browse files Browse the repository at this point in the history
  • Loading branch information
boxbeam committed Sep 16, 2022
1 parent 2d60548 commit 6267ef8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion res/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: RedLib
main: redempt.redlib.RedLib
version: 2022-09-16 03:17
version: 2022-09-16 05:12
author: Redempt
api-version: 1.13
load: STARTUP
4 changes: 3 additions & 1 deletion src/redempt/redlib/misc/EventListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ public EventListener(Plugin plugin, Class<T> eventClass, Consumer<T> handler) {

@EventHandler
public void handleEvent(T event) {
handler.accept(this, event);
if (eventClass.isAssignableFrom(event.getClass())) {
handler.accept(this, event);
}
}

/**
Expand Down

0 comments on commit 6267ef8

Please sign in to comment.