mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-06 16:37:38 +01:00
Remove unnecessary generic
This commit is contained in:
parent
9177e94d1b
commit
a15717ae49
@ -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)));
|
||||
}
|
||||
|
||||
|
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user