Package com.minecolonies.api.eventbus
Class DefaultEventBus
java.lang.Object
com.minecolonies.api.eventbus.DefaultEventBus
- All Implemented Interfaces:
EventBus
Default implementation of the mod event bus.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.minecolonies.api.eventbus.EventBus
EventBus.EventHandler<T extends IModEvent> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidPosts a new event on the event bus for the given type.<T extends IModEvent>
voidsubscribe(@NotNull Class<T> eventType, @NotNull EventBus.EventHandler<T> handler) Subscribe to the given event type, providing a handler function.
-
Constructor Details
-
DefaultEventBus
public DefaultEventBus()
-
-
Method Details
-
subscribe
public <T extends IModEvent> void subscribe(@NotNull @NotNull Class<T> eventType, @NotNull @NotNull EventBus.EventHandler<T> handler) Description copied from interface:EventBusSubscribe to the given event type, providing a handler function. -
post
Description copied from interface:EventBusPosts a new event on the event bus for the given type.
-