From 93405cd180df6e38f7c5d172a441f014eebea490 Mon Sep 17 00:00:00 2001 From: TheMode Date: Sat, 14 Aug 2021 21:28:51 +0200 Subject: [PATCH] Style --- src/main/java/net/minestom/server/event/EventNode.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/minestom/server/event/EventNode.java b/src/main/java/net/minestom/server/event/EventNode.java index dd57afdcb..990483a89 100644 --- a/src/main/java/net/minestom/server/event/EventNode.java +++ b/src/main/java/net/minestom/server/event/EventNode.java @@ -528,11 +528,12 @@ public class EventNode { public void map(@NotNull EventNode node, @NotNull Object value) { final var nodeType = node.eventType; + final var valueType = value.getClass(); final boolean correct = getEventFilters(nodeType).stream().anyMatch(eventFilter -> { final var handlerType = eventFilter.handlerType(); - return handlerType != null && handlerType.isAssignableFrom(value.getClass()); + return handlerType != null && handlerType.isAssignableFrom(valueType); }); - Check.stateCondition(!correct, "The node {0} is not compatible with objects of type {1}", nodeType, value.getClass()); + Check.stateCondition(!correct, "The node filter {0} is not compatible with type {1}", nodeType, valueType); //noinspection unchecked this.mappedNode.put(value, (EventNode) node); }