Package wtf.nucker.kitpvpplus.api.events
Class StateChangeEvent
java.lang.Object
org.bukkit.event.Event
wtf.nucker.kitpvpplus.api.events.StateChangeEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
public abstract class StateChangeEvent
extends org.bukkit.event.Event
implements org.bukkit.event.Cancellable
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionStateChangeEvent(org.bukkit.entity.Player player, PlayerState oldState, PlayerState newState) -
Method Summary
Modifier and TypeMethodDescriptionstatic org.bukkit.event.HandlerListorg.bukkit.event.HandlerListorg.bukkit.entity.PlayerbooleanSee if the event is canceledvoidsetCancelled(boolean cancel)Cancel/uncancel the event This sets the player's state back to the old state.abstract voidsetNewState(PlayerState state)Set a new stateMethods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
StateChangeEvent
public StateChangeEvent(org.bukkit.entity.Player player, PlayerState oldState, PlayerState newState)
-
-
Method Details
-
isCancelled
public boolean isCancelled()See if the event is canceled- Specified by:
isCancelledin interfaceorg.bukkit.event.Cancellable- Returns:
- if the event is canceled
- See Also:
StateChangeEvent#setCancelled(boolean) to cancel/uncancel the event
-
setCancelled
public void setCancelled(boolean cancel)Cancel/uncancel the event This sets the player's state back to the old state. It will scuff up locations- Specified by:
setCancelledin interfaceorg.bukkit.event.Cancellable- Parameters:
cancel- weather it should be cancelled or not
-
getHandlers
public org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlersin classorg.bukkit.event.Event
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList() -
getPlayer
public org.bukkit.entity.Player getPlayer()- Returns:
- the player whose state is being changed
-
getNewState
- Returns:
- the new state of the player
-
getOldState
- Returns:
- the old state of the player
-
setNewState
Set a new state- Parameters:
state- the new state
-