Class EventUtil
java.lang.Object
kr.toxicity.model.api.util.EventUtil
Utility class for dispatching model events.
This class provides helper methods to call events on the BetterModelEventBus
and handle cancellable events conveniently.
- Since:
- 2.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends ModelEvent>
BetterModelEventBus.ResultCalls an event on the global event bus.
-
Method Details
-
call
@NotNull public static <T extends ModelEvent> BetterModelEventBus.Result call(@NotNull @NotNull Class<T> eventClass, @NotNull @NotNull Supplier<T> eventSupplier) Calls an event on the global event bus.- Type Parameters:
T- the type of the event- Parameters:
eventClass- the class of the eventeventSupplier- a supplier that creates the event- Returns:
- the result of the event call
- Since:
- 2.0.0
-