Class CurrencyTransactionEvent
java.lang.Object
org.bukkit.event.Event
dev.itsharshxd.zentrix.api.events.ZentrixEvent
dev.itsharshxd.zentrix.api.events.currency.CurrencyTransactionEvent
Called after a balance change has been committed, as the counterpart of the cancellable
CurrencyChangeEvent that came before it.
Committed means written to storage or, for a reward while storage cannot take it, kept for storage to receive as soon as it can, so the change will not be lost or applied twice. A change that was cancelled, refused or left the balance as it was is not reported. Nothing about the change can be altered any more.
Fired on the main thread, shortly after the change, and only while a listener is registered.
- Since:
- 1.8.0
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionCurrencyTransactionEvent(@NotNull UUID playerId, double oldBalance, double newBalance, CurrencyChangeEvent.ChangeReason reason, @Nullable String source) -
Method Summary
Modifier and TypeMethodDescriptiondoubleHow much the balance moved; negative for a loss.static @NotNull org.bukkit.event.HandlerList@NotNull org.bukkit.event.HandlerListGets the handler list for this event.doubleThe balance after the change.doubleThe balance before the change.@NotNull UUIDThe player whose balance changed.What kind of change it was.@Nullable StringThe specific source, such as"player-kill"or an addon's own source.Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
CurrencyTransactionEvent
public CurrencyTransactionEvent(@NotNull @NotNull UUID playerId, double oldBalance, double newBalance, @NotNull CurrencyChangeEvent.ChangeReason reason, @Nullable @Nullable String source)
-
-
Method Details
-
getPlayerId
The player whose balance changed. -
getOldBalance
public double getOldBalance()The balance before the change. -
getNewBalance
public double getNewBalance()The balance after the change. -
getChangeAmount
public double getChangeAmount()How much the balance moved; negative for a loss. -
getReason
What kind of change it was. -
getSource
The specific source, such as"player-kill"or an addon's own source. -
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()Description copied from class:ZentrixEventGets the handler list for this event.- Overrides:
getHandlersin classZentrixEvent- Returns:
- The handler list
-
getHandlerList
@NotNull public static @NotNull org.bukkit.event.HandlerList getHandlerList()
-