Class AsyncMarketRestockEvent

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

public class AsyncMarketRestockEvent extends MarketEvent implements Cancellable
Called before the market is restocked. Normally called Asyncronously.
  • Constructor Details

    • AsyncMarketRestockEvent

      public AsyncMarketRestockEvent(@NotNull @NotNull Map<Material,Long> oldStock, @NotNull @NotNull Map<Material,Long> newStock)
      Creates a new AsyncMarketRestockEvent.
      Parameters:
      oldStock - Map of Material to Old Stock Amount
      newStock - Map of Material to New Stock Amount
  • Method Details

    • getOldStock

      @NotNull public @NotNull Map<Material,Long> getOldStock()
      Fetches how much stock there was before the restock.
      Returns:
      Map of Old Stock Material to Amount
    • getOldStock

      public long getOldStock(@NotNull @NotNull Material m)
      Fetches how much stock there was before the restock.
      Parameters:
      m - Material to fetch
      Returns:
      Old Stock Amount
    • getNewStock

      @NotNull public @NotNull Map<Material,Long> getNewStock()
      Fetches how much stock there will be after the restock.
      Returns:
      Map of New Stock Material to Amount
    • getNewStock

      public long getNewStock(@NotNull @NotNull Material m)
      Fetches how much stock there will be after the restock.
      Parameters:
      m - Material to fetch
      Returns:
      New Stock Amount
    • setNewStock

      public void setNewStock(Material m, long newStock)
      Sets how much stock there will be after the restock.
      Parameters:
      m - Material to set
      newStock - New Stock Amount
    • setNewStock

      public void setNewStock(@NotNull @NotNull Map<Material,Long> newStock)
      Sets how much stock there will be after the restock.
      Parameters:
      newStock - New Stock Map
    • isCancelled

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

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