BetterModelEventBus

A central event bus for handling model-related events.

This interface allows subscribing to and publishing ModelEvents. It serves as a decoupling mechanism between different parts of the engine.

Since

2.0.0

Types

Link copied to clipboard
enum Result
Represents the outcome of an event publication.

Functions

Link copied to clipboard
@NotNull
open fun call(@NotNull event: @NotNull ModelEvent): @NotNull BetterModelEventBus.Result
abstract fun <T : ModelEvent?> call(@NotNull eventClass: @NotNull Class<out T>, @NotNull eventSupplier: @NotNull Supplier<T>): @NotNull BetterModelEventBus.Result
Publishes an event to all registered subscribers.
Link copied to clipboard
@NotNull
abstract fun <T : ModelEvent?> subscribe(@NotNull application: @NotNull ModelEventApplication, @NotNull eventClass: @NotNull Class<T>, @NotNull consumer: @NotNull Consumer<T>): @NotNull ModelEventListener
Subscribes a consumer to a specific event type.