BetterModelBukkitEvent

A wrapper class that adapts ModelEvent to Bukkit's Event system.

This allows Bukkit plugins to listen for BetterModel events using the standard Bukkit event API. The underlying ModelEvent is lazily initialized when accessed.

Since

2.0.0

Constructors

Link copied to clipboard
@ApiStatus.Internal
constructor(@NotNull eventClass: @NotNull Class<out ModelEvent>, @NotNull supplier: @NotNull Supplier<out ModelEvent>)
Creates a new BetterModelBukkitEvent.

Functions

Link copied to clipboard
open fun <T : ModelEvent?> as(@NotNull eventClass: @NotNull Class<T>): @Nullable T
Casts the wrapped event to the specified class if possible.
open fun <T : ModelEvent?> as(@NotNull eventClass: @NotNull Class<T>, @NotNull consumer: @NotNull Consumer<in T>)
Executes a consumer if the wrapped event is of the specified type.
Link copied to clipboard
open fun callEvent(): Boolean
Link copied to clipboard
open fun getEventName(): @NotNull String
Link copied to clipboard
open fun getHandlerList(): HandlerList
Returns the handler list for this event.
Link copied to clipboard
@NotNull
open fun getHandlers(): @NotNull HandlerList
Link copied to clipboard
open fun <T : ModelEvent?> is(@NotNull eventClass: @NotNull Class<T>): Boolean
Checks if the wrapped event is an instance of the specified class.
Link copied to clipboard
Link copied to clipboard
@ApiStatus.Internal
@Nullable
open fun source(): @Nullable ModelEvent
Returns the underlying model event, if initialized.