Class LambdaEventHandler<T extends GeyserEvent>
java.lang.Object
org.geysermc.geyser.event.handlers.EventHandler<T>
org.geysermc.geyser.event.handlers.LambdaEventHandler<T>
- All Implemented Interfaces:
Comparable<EventHandler<T>>
,Comparator<EventHandler<T>>
- Direct Known Subclasses:
ExtensionLambdaEventHandler
Provides an event handler for an annotated method
-
Nested Class Summary
Nested classes/interfaces inherited from class org.geysermc.geyser.event.handlers.EventHandler
EventHandler.EventHandlerException, EventHandler.Priority
-
Constructor Summary
ConstructorDescriptionLambdaEventHandler(EventManager manager, Class<T> cls, BiConsumer<T,EventHandler<T>> consumer)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Execute the EventHandler with an EventBiConsumer<T,EventHandler<T>>
int
Return our priorityignoreCancelled(boolean ignoreCancelled)
Set if the handler should ignore cancelled events Defaults to Trueboolean
priority(int priority)
Set the Event Priority Defaults to PRIORTY.NORMAL (50)Methods inherited from class org.geysermc.geyser.event.handlers.EventHandler
compare, compareTo, getEventClass, getManager, unregister
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
LambdaEventHandler
public LambdaEventHandler(EventManager manager, Class<T> cls, BiConsumer<T,EventHandler<T>> consumer)
-
-
Method Details
-
priority
Set the Event Priority Defaults to PRIORTY.NORMAL (50)- Parameters:
priority
- Priority to set- Returns:
- the Event Handler
-
ignoreCancelled
Set if the handler should ignore cancelled events Defaults to True- Parameters:
ignoreCancelled
- set true to ignore cancelled events- Returns:
- the Event Handler
-
execute
Execute the EventHandler with an Event- Specified by:
execute
in classEventHandler<T extends GeyserEvent>
- Parameters:
event
- Event passed to handler
-
getConsumer
-
getPriority
public int getPriority()Description copied from class:EventHandler
Return our priority- Specified by:
getPriority
in classEventHandler<T extends GeyserEvent>
- Returns:
- the priority
-
isIgnoreCancelled
public boolean isIgnoreCancelled()
-