Class AutomaticTaxEvent
java.lang.Object
org.bukkit.event.Event
us.teaminceptus.novaconomy.api.events.AutomaticTaxEvent
- All Implemented Interfaces:
Cancellable
Called when Automatic Tax Happens
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionAutomaticTaxEvent(Map<NovaPlayer, Map<Economy, Double>> previousBalances, Map<NovaPlayer, Map<Economy, Double>> taxAmount) Constructs an AutomaticTaxEvent. -
Method Summary
Modifier and TypeMethodDescription@NotNull Map<NovaPlayer,Map<Economy, Double>> Fetches all of the new balances for all players.@NotNull Map<NovaPlayer,Map<Economy, Double>> Fetches all of the previous balances for all players.@NotNull Map<NovaPlayer,Map<Economy, Double>> Fetches all of the tax amounts for all players.static HandlerListFetches the Event's HandlerList.getNewBalance(@NotNull NovaPlayer np) Fetches a NovaPlayer's new balance.getPreviousBalance(@NotNull NovaPlayer np) Fetches a NovaPlayer's previous balance.getTaxAmount(@NotNull NovaPlayer np) Fetches a NovaPlayer's tax amount.booleanWhether the Tax Event should not happen.voidsetCancelled(boolean b) Sets whether the Tax Event should not happen.Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
AutomaticTaxEvent
public AutomaticTaxEvent(Map<NovaPlayer, Map<Economy, Double>> previousBalances, Map<NovaPlayer, Map<Economy, Double>> taxAmount) Constructs an AutomaticTaxEvent.- Parameters:
previousBalances- A Map of Players to the economies affected and their previous balancestaxAmount- A Map of Players to the economies affected and the amount removed
-
-
Method Details
-
isCancelled
public boolean isCancelled()Whether the Tax Event should not happen.- Specified by:
isCancelledin interfaceCancellable- Returns:
- true if tax event is cancelled, else false
-
setCancelled
public void setCancelled(boolean b) Sets whether the Tax Event should not happen.- Specified by:
setCancelledin interfaceCancellable- Parameters:
b- true if tax event is cancelled, else false
-
getAllPreviousBalances
Fetches all of the previous balances for all players.- Returns:
- A Map of Players to their previous balances.
-
getAllNewBalances
Fetches all of the new balances for all players.- Returns:
- A Map of Players to their new balances.
-
getAllTaxAmount
Fetches all of the tax amounts for all players.- Returns:
- A Map of Players to their tax amounts.
-
getPreviousBalance
@Nullable public @Nullable Map<Economy,Double> getPreviousBalance(@NotNull @NotNull NovaPlayer np) throws IllegalArgumentException Fetches a NovaPlayer's previous balance.- Parameters:
np- The NovaPlayer to fetch the balance for.- Returns:
- A Map of Economies to their amounts for their previous balance, or null if the NovaPlayer is not in the event.
- Throws:
IllegalArgumentException- if NovaPlayer is null
-
getNewBalance
@Nullable public @Nullable Map<Economy,Double> getNewBalance(@NotNull @NotNull NovaPlayer np) throws IllegalArgumentException Fetches a NovaPlayer's new balance.- Parameters:
np- The NovaPlayer to fetch the balance for.- Returns:
- A Map of Economies to their amounts for their new balance, or null if the NovaPlayer is not in the event.
- Throws:
IllegalArgumentException- if NovaPlayer is null
-
getTaxAmount
@Nullable public @Nullable Map<Economy,Double> getTaxAmount(@NotNull @NotNull NovaPlayer np) throws IllegalArgumentException Fetches a NovaPlayer's tax amount.- Parameters:
np- The NovaPlayer to fetch the tax amount for.- Returns:
- A Map of Economies to their amounts for their tax amount, or null if the NovaPlayer is not in the event.
- Throws:
IllegalArgumentException- if NovaPlayer is null
-
getHandlers
- Specified by:
getHandlersin classEvent
-
getHandlerList
Fetches the Event's HandlerList.- Returns:
- The Event's HandlerList.
-