public interface EventBus
The event bus is responsible for posting gaia events.
-
Method Summary
Modifier and TypeMethodDescription<T extends GaiaEvent>
booleanpost(T event) Post an event.postArenaAnalyzeEvent(Arena arena, long time) Posts a newArenaAnalyzeEvent.postArenaRevertEvent(Arena arena, long time, boolean completed) Posts a newArenaRevertEvent.postChunkAnalyzeEvent(ChunkRegion chunkRegion, net.kyori.adventure.key.Key level, long time) Posts a newChunkAnalyzeEvent.postChunkRevertEvent(ChunkRegion chunkRegion, net.kyori.adventure.key.Key level, long time) Posts a newChunkRevertEvent.voidshutdown()Close this event bus preventing any further events from being posted.default <T extends GaiaEvent>
voidRegisters the given subscriber to receive events.<T extends GaiaEvent>
voidRegisters the given subscriber to receive events.
-
Method Details
-
shutdown
void shutdown()Close this event bus preventing any further events from being posted. -
subscribe
Registers the given subscriber to receive events.- Type Parameters:
T- the event type- Parameters:
event- the event typesubscriber- the subscriber- See Also:
-
subscribe
Registers the given subscriber to receive events.- Type Parameters:
T- the event type- Parameters:
event- the event typesubscriber- the subscriberpriority- the subscriber's priority, default priority is 0
-
post
Post an event.- Type Parameters:
T- the type of event- Parameters:
event- the event to post- Returns:
- true if the event was successfully posted, false otherwise
-
postArenaAnalyzeEvent
Posts a newArenaAnalyzeEvent.- Parameters:
arena- the arena that was being analyzedtime- the amount of time it took to analyze the arena in milliseconds
-
postArenaRevertEvent
Posts a newArenaRevertEvent.- Parameters:
arena- the arena that was being revertedtime- the amount of time it took to revert the arena in millisecondscompleted- whether reverting was successful and operation has completed
-
postChunkAnalyzeEvent
ChunkAnalyzeEvent postChunkAnalyzeEvent(ChunkRegion chunkRegion, net.kyori.adventure.key.Key level, long time) Posts a newChunkAnalyzeEvent.- Parameters:
chunkRegion- the chunk that was analyzedlevel- level keytime- the amount of time it took to analyze the chunk in milliseconds
-
postChunkRevertEvent
ChunkRevertEvent postChunkRevertEvent(ChunkRegion chunkRegion, net.kyori.adventure.key.Key level, long time) Posts a newChunkRevertEvent.- Parameters:
chunkRegion- the chunk that was revertedlevel- level keytime- the amount of time it took to revert the chunk in milliseconds
-