mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-08 17:37:42 +01:00
Inline method
This commit is contained in:
parent
1a9bdd93d7
commit
8f3b52a8b9
@ -13,7 +13,7 @@ import java.util.function.Function;
|
|||||||
|
|
||||||
public interface EventFilter<E extends Event, H> {
|
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<EntityEvent, Entity> ENTITY = from(EntityEvent.class, EntityEvent::getEntity);
|
||||||
EventFilter<PlayerEvent, Player> PLAYER = from(PlayerEvent.class, PlayerEvent::getPlayer);
|
EventFilter<PlayerEvent, Player> PLAYER = from(PlayerEvent.class, PlayerEvent::getPlayer);
|
||||||
EventFilter<ItemEvent, ItemStack> ITEM = from(ItemEvent.class, ItemEvent::getItemStack);
|
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);
|
@Nullable H getHandler(@NotNull E event);
|
||||||
|
|
||||||
@NotNull Class<E> getEventType();
|
@NotNull Class<E> getEventType();
|
||||||
|
Loading…
Reference in New Issue
Block a user