From 4680dbd64ec7a42d68d80881e801cfcfd01369a3 Mon Sep 17 00:00:00 2001 From: TheMode Date: Fri, 27 Aug 2021 09:55:10 +0200 Subject: [PATCH] Reuse call method for mapped nodes Signed-off-by: TheMode --- src/main/java/net/minestom/server/event/EventNodeImpl.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/main/java/net/minestom/server/event/EventNodeImpl.java b/src/main/java/net/minestom/server/event/EventNodeImpl.java index ebd882c15..aeece586d 100644 --- a/src/main/java/net/minestom/server/event/EventNodeImpl.java +++ b/src/main/java/net/minestom/server/event/EventNodeImpl.java @@ -339,12 +339,7 @@ class EventNodeImpl implements EventNode { final BiConsumer, E> mapper = (filter, event) -> { final Object handler = filter.castHandler(event); final Handle handle = handlers.get(handler); - if (handle != null) { // Run the listeners of the mapped node - handle.update(); - for (Consumer listener : handle.listeners) { - listener.accept(event); - } - } + if (handle != null) handle.call(event); }; if (filterList.length == 1) { final var firstFilter = filterList[0];