Interface EventFilter<E extends Event, H>
- Type Parameters:
E- The event type to filterH- The handler type to filter on.
public interface EventFilter<E extends Event, H>
Represents a filter for a specific
Event type.
The handler represents a "target" of the event. This can be used to create filters for all events of a specific type using information about the target.
For example, the target of a PlayerEvent is a Player so
you could create a player event filter which checks if the target player
is in creative mode.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final EventFilter<Event, ?> static final EventFilter<BlockEvent, Block> static final EventFilter<EntityEvent, Entity> static final EventFilter<InstanceEvent, Instance> static final EventFilter<InventoryEvent, AbstractInventory> static final EventFilter<ItemEvent, ItemStack> static final EventFilter<PlayerEvent, Player> -
Method Summary
Modifier and TypeMethodDescriptiondefault HcastHandler(Object event) The event type to filter on.static <E extends Event, H>
EventFilter<E, H> getHandler(E event) Gets the handler for the given event instance, or null if the event type has no handler.The type returned bygetHandler(Event).
-
Field Details
-
ALL
-
ENTITY
-
PLAYER
-
ITEM
-
INSTANCE
-
INVENTORY
-
BLOCK
-
-
Method Details
-
from
-
getHandler
-
castHandler
-
eventType
-
handlerType
The type returned bygetHandler(Event).- Returns:
- the handler type, null if not any
-