Package dev.boze.api.event
Class CancellableEvent
java.lang.Object
dev.boze.api.event.CancellableEvent
- Direct Known Subclasses:
EventRotate
Base class for cancellable events
Cancellable events can be cancelled by addons to prevent the default behavior.
Other addons can check if an event is cancelled to modify their behavior accordingly.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()Cancels this event, preventing the default behaviorbooleanReturns whether this event has been cancelledvoidsetCancelled(boolean cancelled) Sets whether this event is cancelled
-
Constructor Details
-
CancellableEvent
public CancellableEvent()
-
-
Method Details
-
cancel
public void cancel()Cancels this event, preventing the default behavior -
setCancelled
public void setCancelled(boolean cancelled) Sets whether this event is cancelled- Parameters:
cancelled- Whether the event should be cancelled
-
isCancelled
public boolean isCancelled()Returns whether this event has been cancelled- Returns:
- true if the event is cancelled, false otherwise
-