Class AutomaticTaxEvent

java.lang.Object
org.bukkit.event.Event
us.teaminceptus.novaconomy.api.events.AutomaticTaxEvent
All Implemented Interfaces:
Cancellable

public class AutomaticTaxEvent extends Event implements Cancellable
Called when Automatic Tax Happens
  • 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 balances
      taxAmount - 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:
      isCancelled in interface Cancellable
      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:
      setCancelled in interface Cancellable
      Parameters:
      b - true if tax event is cancelled, else false
    • getAllPreviousBalances

      @NotNull public @NotNull Map<NovaPlayer,Map<Economy,Double>> getAllPreviousBalances()
      Fetches all of the previous balances for all players.
      Returns:
      A Map of Players to their previous balances.
    • getAllNewBalances

      @NotNull public @NotNull Map<NovaPlayer,Map<Economy,Double>> getAllNewBalances()
      Fetches all of the new balances for all players.
      Returns:
      A Map of Players to their new balances.
    • getAllTaxAmount

      @NotNull public @NotNull Map<NovaPlayer,Map<Economy,Double>> 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

      public HandlerList getHandlers()
      Specified by:
      getHandlers in class Event
    • getHandlerList

      public static HandlerList getHandlerList()
      Fetches the Event's HandlerList.
      Returns:
      The Event's HandlerList.