Class PlayerChangeBalanceEvent

All Implemented Interfaces:
Cancellable
Direct Known Subclasses:
PlayerPayEvent

public class PlayerChangeBalanceEvent extends PlayerEconomyEvent implements Cancellable
Called when a player's balance changes
  • Constructor Details

    • PlayerChangeBalanceEvent

      public PlayerChangeBalanceEvent(Player target, Economy econ, double amount, double previousBal, double newBal, boolean isNatural)
      Called when a Player's Balance Changes
      Parameters:
      target - Target involved in this event
      econ - Economy involved
      amount - Amount added
      previousBal - Previous Balance
      newBal - New Balance (previousBal + amount = newBal is NOT being checked)
      isNatural - If this addition was natural
      See Also:
  • Method Details

    • isNatural

      public boolean isNatural()
      Whether this increase was caused by a natural event (i.e. fishing increase)
      Returns:
      true if natural, else false
    • getPreviousBalance

      public double getPreviousBalance()
      Fetch the previous balance of this player
      Returns:
      Previous Balance
    • getNewBalance

      public double getNewBalance()
      Fetch the new balance of this player
      Returns:
      New Balance
    • isCancelled

      public boolean isCancelled()
      Specified by:
      isCancelled in interface Cancellable
    • setCancelled

      public void setCancelled(boolean isCancelled)
      Specified by:
      setCancelled in interface Cancellable