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
ConstructorsConstructorDescriptionLambdaEventHandler(EventManager manager, Class<T> cls, BiConsumer<T,EventHandler<T>> consumer) -
Method Summary
Modifier and TypeMethodDescriptionvoidExecute the EventHandler with an EventBiConsumer<T,EventHandler<T>>intReturn our priorityignoreCancelled(boolean ignoreCancelled)Set if the handler should ignore cancelled events Defaults to Truebooleanpriority(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, unregisterMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
executein classEventHandler<T extends GeyserEvent>- Parameters:
event- Event passed to handler
-
getConsumer
-
getPriority
public int getPriority()Description copied from class:EventHandlerReturn our priority- Specified by:
getPriorityin classEventHandler<T extends GeyserEvent>- Returns:
- the priority
-
isIgnoreCancelled
public boolean isIgnoreCancelled()
-