Package net.lapismc.lapiscore.events
Class LapisCoreCancellableEvent
- java.lang.Object
-
- org.bukkit.event.Event
-
- net.lapismc.lapiscore.events.LapisCoreEvent
-
- net.lapismc.lapiscore.events.LapisCoreCancellableEvent
-
- All Implemented Interfaces:
org.bukkit.event.Cancellable
public class LapisCoreCancellableEvent extends LapisCoreEvent implements org.bukkit.event.Cancellable
An utility class to make cancellable events
-
-
Field Summary
-
Fields inherited from class net.lapismc.lapiscore.events.LapisCoreEvent
handlers
-
-
Constructor Summary
Constructors Constructor Description LapisCoreCancellableEvent()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.StringgetReason()Get the reason fromsetCancelled(boolean, String)booleanisCancelled()Check if the event is cancelledvoidsetCancelled(boolean cancel)Deprecated.voidsetCancelled(boolean cancel, java.lang.String reason)Cancel the event with a reason-
Methods inherited from class net.lapismc.lapiscore.events.LapisCoreEvent
getHandlerList, getHandlers
-
-
-
-
Method Detail
-
isCancelled
public boolean isCancelled()
Check if the event is cancelled- Specified by:
isCancelledin interfaceorg.bukkit.event.Cancellable- Returns:
- Returns true if the event has been cancelled by an event listener
-
setCancelled
@Deprecated public void setCancelled(boolean cancel)
Deprecated.Please usesetCancelled(boolean, String)to provide a reason for why you are cancelling the event- Specified by:
setCancelledin interfaceorg.bukkit.event.Cancellable- Parameters:
cancel- The boolean value for the cancelled state of the event
-
setCancelled
public void setCancelled(boolean cancel, java.lang.String reason)Cancel the event with a reason- Parameters:
cancel- True if the event should be cancelledreason- The reason to be sent to the player as to why the event was cancelled, Not all plugins implement this
-
getReason
public java.lang.String getReason()
Get the reason fromsetCancelled(boolean, String)- Returns:
- Returns the String reason as to why the event was cancelled, This will probably be null if the event is not cancelled
-
-