mirror of
https://github.com/Minestom/Minestom.git
synced 2024-12-30 21:17:53 +01:00
Reuse call method for mapped nodes
Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
parent
5c9c57439a
commit
4680dbd64e
@ -339,12 +339,7 @@ class EventNodeImpl<T extends Event> implements EventNode<T> {
|
||||
final BiConsumer<EventFilter<E, ?>, E> mapper = (filter, event) -> {
|
||||
final Object handler = filter.castHandler(event);
|
||||
final Handle<E> handle = handlers.get(handler);
|
||||
if (handle != null) { // Run the listeners of the mapped node
|
||||
handle.update();
|
||||
for (Consumer<E> listener : handle.listeners) {
|
||||
listener.accept(event);
|
||||
}
|
||||
}
|
||||
if (handle != null) handle.call(event);
|
||||
};
|
||||
if (filterList.length == 1) {
|
||||
final var firstFilter = filterList[0];
|
||||
|
Loading…
Reference in New Issue
Block a user