Class ForgeEventCancellationCarrier<T extends net.minecraftforge.eventbus.api.Event>

java.lang.Object
com.blamejared.crafttweaker.api.event.ForgeEventCancellationCarrier<T>
Type Parameters:
T - The type of the event.
All Implemented Interfaces:
IEventCancellationCarrier<T>

public final class ForgeEventCancellationCarrier<T extends net.minecraftforge.eventbus.api.Event> extends Object implements IEventCancellationCarrier<T>
Represents the cancellation carrier for all Forge events.

This carrier relies on the Event interface to verify the cancellation status of a particular event.

Since:
11.0.0
  • Method Details

    • of

      public static <T> IEventCancellationCarrier<T> of()
    • isCanceled

      public boolean isCanceled(T event)
      Description copied from interface: IEventCancellationCarrier
      Returns whether the given event has been canceled or not.
      Specified by:
      isCanceled in interface IEventCancellationCarrier<T extends net.minecraftforge.eventbus.api.Event>
      Parameters:
      event - The event whose cancellation status should be determined.
      Returns:
      Whether the event has been canceled.
    • cancel

      public void cancel(T event)
      Description copied from interface: IEventCancellationCarrier
      Cancels the given event.

      The cancellation operation must be idempotent, meaning that attempting to cancel an event that has already been canceled before should result in no operations being carried out.

      Specified by:
      cancel in interface IEventCancellationCarrier<T extends net.minecraftforge.eventbus.api.Event>
      Parameters:
      event - The event to cancel.