Class PlayerChangeBalanceEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
us.teaminceptus.novaconomy.api.events.player.economy.PlayerEconomyEvent
us.teaminceptus.novaconomy.api.events.player.economy.PlayerChangeBalanceEvent
- All Implemented Interfaces:
Cancellable
- Direct Known Subclasses:
PlayerPayEvent
Called when a player's balance changes
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result -
Field Summary
Fields inherited from class org.bukkit.event.player.PlayerEvent
player -
Constructor Summary
ConstructorsConstructorDescriptionPlayerChangeBalanceEvent(Player target, Economy econ, double amount, double previousBal, double newBal, boolean isNatural) Called when a Player's Balance Changes -
Method Summary
Modifier and TypeMethodDescriptiondoubleFetch the new balance of this playerdoubleFetch the previous balance of this playerbooleanbooleanWhether this increase was caused by a natural event (i.e.voidsetCancelled(boolean isCancelled) Methods inherited from class us.teaminceptus.novaconomy.api.events.player.economy.PlayerEconomyEvent
getAmount, getEconomy, getHandlerList, getHandlersMethods inherited from class org.bukkit.event.player.PlayerEvent
getPlayerMethods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
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 eventecon- Economy involvedamount- Amount addedpreviousBal- Previous BalancenewBal- 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:
isCancelledin interfaceCancellable
-
setCancelled
public void setCancelled(boolean isCancelled) - Specified by:
setCancelledin interfaceCancellable
-