Class EventManager
java.lang.Object
com.github.retrooper.packetevents.event.EventManager
Class for event managing. Implements both, internal and API methods.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
callEvent
(PacketEvent event) Call the PacketEvent.void
callEvent
(PacketEvent event, @Nullable Runnable postCallListenerAction) Call the PacketEvent.registerListener
(PacketListenerCommon listener) Register the dynamic packet event listener.registerListener
(PacketListener listener, PacketListenerPriority priority) Register the dynamic packet event listener.registerListeners
(PacketListenerCommon... listeners) Register multiple dynamic packet event listeners with one method.void
Unregister all dynamic packet event listeners.void
unregisterListener
(PacketListenerCommon listener) void
unregisterListeners
(PacketListenerCommon... listeners)
-
Constructor Details
-
EventManager
public EventManager()
-
-
Method Details
-
callEvent
Call the PacketEvent. This method processes the event on all the registered dynamic packet event listeners. ThePacketListenerPriority.LOWEST
prioritized listeners will be processing first, thePacketListenerPriority.MONITOR
will be processing last and can be the final decider whether the event has been cancelled or not.- Parameters:
event
-PacketEvent
-
callEvent
Call the PacketEvent. This method processes the event on all the registered dynamic packet event listeners. ThePacketListenerPriority.LOWEST
prioritized listeners will be processing first, thePacketListenerPriority.MONITOR
will be processing last and can be the final decider whether the event has been cancelled or not.- Parameters:
event
-PacketEvent
postCallListenerAction
- The action to be ran after all the listeners have finished processing
-
registerListener
public PacketListenerCommon registerListener(PacketListener listener, PacketListenerPriority priority) Register the dynamic packet event listener.- Parameters:
listener
-PacketListenerCommon
priority
-PacketListenerPriority
-
registerListener
Register the dynamic packet event listener.- Parameters:
listener
-PacketListenerCommon
-
registerListeners
Register multiple dynamic packet event listeners with one method.- Parameters:
listeners
-PacketListenerCommon
-
unregisterListener
-
unregisterListeners
-
unregisterAllListeners
public void unregisterAllListeners()Unregister all dynamic packet event listeners.
-