Class EventUtil

java.lang.Object
kr.toxicity.model.api.util.EventUtil

@Internal public final class EventUtil extends Object
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 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 event
      eventSupplier - a supplier that creates the event
      Returns:
      the result of the event call
      Since:
      2.0.0