Remove unnecessary generic

This commit is contained in:
TheMode 2021-06-03 21:41:28 +02:00
parent 9177e94d1b
commit a15717ae49
2 changed files with 6 additions and 6 deletions

View File

@ -41,14 +41,14 @@ public class EventNode<T extends Event> {
return predicate(filter, (e, h) -> predicate.test(h));
}
public static <E extends Event, V extends TagReadable> EventNode<E> predicateTag(@NotNull EventFilter<E, V> filter,
@NotNull Tag<?> tag) {
public static <E extends Event> EventNode<E> predicateTag(@NotNull EventFilter<E, ? extends TagReadable> filter,
@NotNull Tag<?> tag) {
return predicate(filter, (e, h) -> h.hasTag(tag));
}
public static <E extends Event, V extends TagReadable, V2> EventNode<E> predicateTag(@NotNull EventFilter<E, V> filter,
@NotNull Tag<V2> tag,
@NotNull Predicate<@Nullable V2> consumer) {
public static <E extends Event, V> EventNode<E> predicateTag(@NotNull EventFilter<E, ? extends TagReadable> filter,
@NotNull Tag<V> tag,
@NotNull Predicate<@Nullable V> consumer) {
return predicate(filter, (e, h) -> consumer.test(h.getTag(tag)));
}

View File

@ -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));