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 Summary
Modifier and TypeMethodDescriptionvoidCancels the given event.booleanisCanceled(T event) Returns whether the given event has been canceled or not.static <T> IEventCancellationCarrier<T>of()
-
Method Details
-
of
-
isCanceled
Description copied from interface:IEventCancellationCarrierReturns whether the given event has been canceled or not.- Specified by:
isCanceledin interfaceIEventCancellationCarrier<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
Description copied from interface:IEventCancellationCarrierCancels 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:
cancelin interfaceIEventCancellationCarrier<T extends net.minecraftforge.eventbus.api.Event>- Parameters:
event- The event to cancel.
-