Inline method

This commit is contained in:
TheMode 2021-06-02 23:04:35 +02:00
parent 1a9bdd93d7
commit 8f3b52a8b9

View File

@ -13,7 +13,7 @@ import java.util.function.Function;
public interface EventFilter<E extends Event, H> {
EventFilter<Event, ?> ALL = from(Event.class);
EventFilter<Event, ?> ALL = from(Event.class, null);
EventFilter<EntityEvent, Entity> ENTITY = from(EntityEvent.class, EntityEvent::getEntity);
EventFilter<PlayerEvent, Player> PLAYER = from(PlayerEvent.class, PlayerEvent::getPlayer);
EventFilter<ItemEvent, ItemStack> ITEM = from(ItemEvent.class, ItemEvent::getItemStack);
@ -35,10 +35,6 @@ public interface EventFilter<E extends Event, H> {
};
}
static <E extends Event, H> EventFilter<E, H> from(@NotNull Class<E> type) {
return from(type, null);
}
@Nullable H getHandler(@NotNull E event);
@NotNull Class<E> getEventType();