mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-12-31 21:07:50 +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
|
||||
public final void execute(final Listener listener, final Event event){
|
||||
if (!clazz.isAssignableFrom(event.getClass())){
|
||||
// Strange but true.
|
||||
return;
|
||||
}
|
||||
// TODO: profiling option !
|
||||
final Cancellable cancellable = isCancellable ? (Cancellable) event : null;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user