Class WarpSetEvent
java.lang.Object
org.bukkit.event.Event
net.godlycow.org.essc.api.warp.event.WarpSetEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
public class WarpSetEvent
extends org.bukkit.event.Event
implements org.bukkit.event.Cancellable
Fired when a warp is about to be created.
Cancelling this event blocks the creation. Communicate why via
setCancelReason(String).
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionWarpSetEvent(org.bukkit.entity.Player player, String warpName, org.bukkit.Location location) Creates a new warp set event. -
Method Summary
Modifier and TypeMethodDescriptionReturns why the event was cancelled, or an empty string if not cancelled.static org.bukkit.event.HandlerListorg.bukkit.event.HandlerListorg.bukkit.LocationReturns the warp location (a copy).org.bukkit.entity.PlayerReturns the player creating the warp.Returns the warp name.booleanvoidsetCancelled(boolean cancel) voidsetCancelReason(String cancelReason) Sets why the event is being cancelled.Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
WarpSetEvent
Creates a new warp set event.- Parameters:
player- the player creating the warpwarpName- the warp namelocation- the warp location
-
-
Method Details
-
getPlayer
public org.bukkit.entity.Player getPlayer()Returns the player creating the warp.- Returns:
- the player
-
getWarpName
Returns the warp name.- Returns:
- the warp name
-
getLocation
public org.bukkit.Location getLocation()Returns the warp location (a copy).- Returns:
- the location
-
getCancelReason
Returns why the event was cancelled, or an empty string if not cancelled.- Returns:
- the cancel reason
-
setCancelReason
Sets why the event is being cancelled.- Parameters:
cancelReason- the cancel reason
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelledin interfaceorg.bukkit.event.Cancellable
-
setCancelled
public void setCancelled(boolean cancel) - Specified by:
setCancelledin interfaceorg.bukkit.event.Cancellable
-
getHandlers
public org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlersin classorg.bukkit.event.Event
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList()
-