Class CurrencyTransactionEvent

java.lang.Object
org.bukkit.event.Event
dev.itsharshxd.zentrix.api.events.ZentrixEvent
dev.itsharshxd.zentrix.api.events.currency.CurrencyTransactionEvent

public final class CurrencyTransactionEvent extends ZentrixEvent
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
  • Constructor Details

    • CurrencyTransactionEvent

      public CurrencyTransactionEvent(@NotNull @NotNull UUID playerId, double oldBalance, double newBalance, @NotNull CurrencyChangeEvent.ChangeReason reason, @Nullable @Nullable String source)
  • Method Details

    • getPlayerId

      @NotNull public @NotNull UUID 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

      @NotNull public CurrencyChangeEvent.ChangeReason getReason()
      What kind of change it was.
    • getSource

      @Nullable public @Nullable String 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: ZentrixEvent
      Gets the handler list for this event.
      Overrides:
      getHandlers in class ZentrixEvent
      Returns:
      The handler list
    • getHandlerList

      @NotNull public static @NotNull org.bukkit.event.HandlerList getHandlerList()