mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-02 14:38:26 +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 BiConsumer<EventFilter<E, ?>, E> mapper = (filter, event) -> {
|
||||||
final Object handler = filter.castHandler(event);
|
final Object handler = filter.castHandler(event);
|
||||||
final Handle<E> handle = handlers.get(handler);
|
final Handle<E> handle = handlers.get(handler);
|
||||||
if (handle != null) { // Run the listeners of the mapped node
|
if (handle != null) handle.call(event);
|
||||||
handle.update();
|
|
||||||
for (Consumer<E> listener : handle.listeners) {
|
|
||||||
listener.accept(event);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
if (filterList.length == 1) {
|
if (filterList.length == 1) {
|
||||||
final var firstFilter = filterList[0];
|
final var firstFilter = filterList[0];
|
||||||
|
Loading…
Reference in New Issue
Block a user