From ff5db38d0eaf1cbe461de5a0713c4c563008f214 Mon Sep 17 00:00:00 2001 From: asofold Date: Thu, 8 Nov 2012 19:47:37 +0100 Subject: [PATCH] GenericListener: Don't handle events that can't be handled. For some reason this is needed. --- src/fr/neatmonster/nocheatplus/event/GenericListener.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/fr/neatmonster/nocheatplus/event/GenericListener.java b/src/fr/neatmonster/nocheatplus/event/GenericListener.java index bfdb5723..0da3d6e7 100644 --- a/src/fr/neatmonster/nocheatplus/event/GenericListener.java +++ b/src/fr/neatmonster/nocheatplus/event/GenericListener.java @@ -88,6 +88,10 @@ public class GenericListener 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;