Package de.Keyle.MyPet.api.event
Class CancellablePetEvent
java.lang.Object
org.bukkit.event.Event
de.Keyle.MyPet.api.event.PetEvent
de.Keyle.MyPet.api.event.CancellablePetEvent
- All Implemented Interfaces:
Cancellable
- Direct Known Subclasses:
PetCallEvent,PetDamageEvent,PetExhaustionEvent,PetExpEvent,PetInteractEvent,PetInventoryActionEvent,PetNameEvent,PetOnHitSkillEvent,PetPickupItemEvent,PetSendAwayEvent
Base of every
PetEvent that listeners may veto. It owns the
cancellation flag and the Cancellable contract so that concrete
events do not each carry their own copy.
What cancelling means is defined by each concrete event; see its own
documentation. As with PetEvent, this class has no handler list and
is not a valid @EventHandler parameter type on its own.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates a synchronous, not-yet-cancelled pet event. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns whether a listener has vetoed this event.voidsetCancelled(boolean cancelled) Sets whether this event is vetoed.Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, getHandlers, isAsynchronous
-
Constructor Details
-
CancellablePetEvent
protected CancellablePetEvent()Creates a synchronous, not-yet-cancelled pet event.
-
-
Method Details
-
isCancelled
public boolean isCancelled()Returns whether a listener has vetoed this event.- Specified by:
isCancelledin interfaceCancellable- Returns:
trueif the event has been cancelled
-
setCancelled
public void setCancelled(boolean cancelled) Sets whether this event is vetoed.- Specified by:
setCancelledin interfaceCancellable- Parameters:
cancelled-trueto cancel the event,falseto lift an earlier cancellation
-