Package com.vk2gpz.tokenenchant.event
Class TETokenChangeEvent
java.lang.Object
org.bukkit.event.Event
com.vk2gpz.tokenenchant.event.TETokenChangeEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
public class TETokenChangeEvent
extends org.bukkit.event.Event
implements org.bukkit.event.Cancellable
Called when player's token value has changed.
When player's token balance has changed through adding or removing tokens, this event will be triggered. The event will contain the old token value and the new token value.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTETokenChangeEvent
(org.bukkit.OfflinePlayer player, double oldValue, double newValue, TokenHandlerType type) Constructor -
Method Summary
Modifier and TypeMethodDescriptionstatic org.bukkit.event.HandlerList
@NotNull org.bukkit.event.HandlerList
double
Returns the new token balance.org.bukkit.OfflinePlayer
Returns the OfflinePlayer involved in (target of) this event.double
Returns the old token balance.getType()
Returns the currency type.boolean
void
setCancelled
(boolean b) double
setNewTokenValue
(double newValue) Sets the new new-token balance.Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Field Details
-
cancelled
protected boolean cancelled
-
-
Constructor Details
-
TETokenChangeEvent
public TETokenChangeEvent(org.bukkit.OfflinePlayer player, double oldValue, double newValue, TokenHandlerType type) Constructor- Parameters:
player
- A player whose token balance has been changed.oldValue
- Player's old token balance.newValue
- Player's new token balance.type
- The type of currency.
-
-
Method Details
-
getOfflinePlayer
public org.bukkit.OfflinePlayer getOfflinePlayer()Returns the OfflinePlayer involved in (target of) this event.- Returns:
- the OfflinePlayer object, which is the target of this event.
-
getOldTokenValue
public double getOldTokenValue()Returns the old token balance.- Returns:
- the old token balance.
-
getNewTokenValue
public double getNewTokenValue()Returns the new token balance.- Returns:
- the new token balance.
-
setNewTokenValue
public double setNewTokenValue(double newValue) Sets the new new-token balance.- Parameters:
newValue
- the new new-token balance.- Returns:
- the old new-token balance.
-
getType
Returns the currency type.- Returns:
- the currency type.
-
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlers
in classorg.bukkit.event.Event
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList() -
isCancelled
public boolean isCancelled()- Specified by:
isCancelled
in interfaceorg.bukkit.event.Cancellable
-
setCancelled
public void setCancelled(boolean b) - Specified by:
setCancelled
in interfaceorg.bukkit.event.Cancellable
-