mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-01-18 21:41:21 +01:00
GenericListener: Don't handle events that can't be handled.
For some reason this is needed.
This commit is contained in:
parent
e17cb6f5dd
commit
ff5db38d0e
@ -88,6 +88,10 @@ public class GenericListener<E extends Event> implements Listener, EventExecutor
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void execute(final Listener listener, final Event event){
|
public final void execute(final Listener listener, final Event event){
|
||||||
|
if (!clazz.isAssignableFrom(event.getClass())){
|
||||||
|
// Strange but true.
|
||||||
|
return;
|
||||||
|
}
|
||||||
// TODO: profiling option !
|
// TODO: profiling option !
|
||||||
final Cancellable cancellable = isCancellable ? (Cancellable) event : null;
|
final Cancellable cancellable = isCancellable ? (Cancellable) event : null;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user