diff --git a/src/main/java/net/minestom/server/event/EventNode.java b/src/main/java/net/minestom/server/event/EventNode.java index 25d06e988..e184846f9 100644 --- a/src/main/java/net/minestom/server/event/EventNode.java +++ b/src/main/java/net/minestom/server/event/EventNode.java @@ -41,14 +41,14 @@ public class EventNode { return predicate(filter, (e, h) -> predicate.test(h)); } - public static EventNode predicateTag(@NotNull EventFilter filter, - @NotNull Tag tag) { + public static EventNode predicateTag(@NotNull EventFilter filter, + @NotNull Tag tag) { return predicate(filter, (e, h) -> h.hasTag(tag)); } - public static EventNode predicateTag(@NotNull EventFilter filter, - @NotNull Tag tag, - @NotNull Predicate<@Nullable V2> consumer) { + public static EventNode predicateTag(@NotNull EventFilter filter, + @NotNull Tag tag, + @NotNull Predicate<@Nullable V> consumer) { return predicate(filter, (e, h) -> consumer.test(h.getTag(tag))); } diff --git a/src/test/java/demo/PlayerInit.java b/src/test/java/demo/PlayerInit.java index 672fa7285..7462d28dd 100644 --- a/src/test/java/demo/PlayerInit.java +++ b/src/test/java/demo/PlayerInit.java @@ -153,7 +153,7 @@ public class PlayerInit { var conditional = EventNode.predicateValue(EventFilter.PLAYER, Player::isCreative) .addListener(PlayerMoveEvent.class, (event) -> System.out.println("creative player moved")); - var tagNode = EventNode.predicateTag(EventFilter.ITEM, Tag.String("tag"), s -> s != null && !s.isEmpty()); + var tagNode = EventNode.predicateTag(EventFilter.ITEM, Tag.String("tag")); node.addChild(conditional); node.call(new PlayerTickEvent(null));