Interface BukkitModelEventBus
- All Superinterfaces:
kr.toxicity.model.api.BetterModelEventBus
public interface BukkitModelEventBus
extends kr.toxicity.model.api.BetterModelEventBus
A Bukkit-specific extension of the
BetterModelEventBus.
This interface provides convenience methods for subscribing to events using a Bukkit Plugin instance.
- Since:
- 2.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface kr.toxicity.model.api.BetterModelEventBus
kr.toxicity.model.api.BetterModelEventBus.Result -
Method Summary
Modifier and TypeMethodDescriptiondefault <T extends kr.toxicity.model.api.event.ModelEvent>
@NotNull kr.toxicity.model.api.event.ModelEventListenersubscribe(@NotNull org.bukkit.plugin.Plugin plugin, @NotNull Class<T> eventClass, @NotNull Consumer<T> consumer) Subscribes a consumer to a specific event type, associated with a Bukkit plugin.Methods inherited from interface kr.toxicity.model.api.BetterModelEventBus
call, call, subscribe
-
Method Details
-
subscribe
@NotNull default <T extends kr.toxicity.model.api.event.ModelEvent> @NotNull kr.toxicity.model.api.event.ModelEventListener subscribe(@NotNull @NotNull org.bukkit.plugin.Plugin plugin, @NotNull @NotNull Class<T> eventClass, @NotNull @NotNull Consumer<T> consumer) Subscribes a consumer to a specific event type, associated with a Bukkit plugin.- Type Parameters:
T- the type of the event- Parameters:
plugin- the plugin that subscribes to the eventeventClass- the class of the event to subscribe toconsumer- the consumer to handle the event- Returns:
- a listener handle that can be used to unregister the subscription
- Since:
- 2.0.0
-