Class AutoSellEvent

java.lang.Object
org.bukkit.event.Event
com.vk2gpz.autosell.event.AutoSellEvent
All Implemented Interfaces:
org.bukkit.event.Cancellable

public class AutoSellEvent extends org.bukkit.event.Event implements org.bukkit.event.Cancellable
This event is called when a player sells items automatically. It is used to modify the total amount of money earned and the number of items sold.

This event is cancellable, and if cancelled, the sale will not be processed.

  • Nested Class Summary

    Nested classes/interfaces inherited from class org.bukkit.event.Event

    org.bukkit.event.Event.Result
  • Constructor Summary

    Constructors
    Constructor
    Description
    AutoSellEvent(org.bukkit.entity.Player player, Map<org.bukkit.inventory.ItemStack,Double> itemsSold, double multiplier, Shop shop, org.bukkit.block.Block block)
    Creates a new AutoSellEvent.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.bukkit.block.Block
    Gets the block that the items were sold to.
    static org.bukkit.event.HandlerList
    Gets the handler list for this event.
    @NotNull org.bukkit.event.HandlerList
    Gets the handler list for this event.
    Map<org.bukkit.inventory.ItemStack,Double>
    Gets the items that were sold.
    double
    Gets the multiplier being applied to.
    Gets the player who sold the items.
    org.bukkit.entity.Player
    Gets the player who sold the items.
    double
    Gets the total amount of money earned from the sale.
    Gets the shop that the items were sold to.
    boolean
    Checks if the event has a multiplier or not.
    boolean
    Checks if the event is cancelled or not.
    void
    setBlock(org.bukkit.block.Block block)
    Sets the block that the items were sold to.
    void
    setCancelled(boolean cancelled)
    Sets whether the event is cancelled or not.
    void
    setItemsSold(Map<org.bukkit.inventory.ItemStack,Double> itemsSold)
    Sets the items that were sold.
    void
    setMultiplier(double multiplier)
    Sets the multiplier being applied to.

    Methods inherited from class org.bukkit.event.Event

    getEventName, isAsynchronous

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AutoSellEvent

      public AutoSellEvent(org.bukkit.entity.Player player, Map<org.bukkit.inventory.ItemStack,Double> itemsSold, double multiplier, Shop shop, org.bukkit.block.Block block)
      Creates a new AutoSellEvent.
      Parameters:
      player - The player who sold the items.
      itemsSold - The items that were sold.
      multiplier - The multiplier for the sale.
      shop - The shop that the items were sold to.
      block - The block that the items were sold to.
  • Method Details

    • getName

      public String getName()
      Gets the player who sold the items.
      Returns:
      The player who sold the items.
    • getPlayer

      public org.bukkit.entity.Player getPlayer()
      Gets the player who sold the items.
      Returns:
      The player who sold the items.
    • getHandlers

      @NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()
      Gets the handler list for this event.
      Specified by:
      getHandlers in class org.bukkit.event.Event
      Returns:
      The handler list for this event.
    • getHandlerList

      public static org.bukkit.event.HandlerList getHandlerList()
      Gets the handler list for this event.
      Returns:
      The handler list for this event.
    • isCancelled

      public boolean isCancelled()
      Checks if the event is cancelled or not.
      Specified by:
      isCancelled in interface org.bukkit.event.Cancellable
      Returns:
      Whether the event is cancelled or not.
    • setCancelled

      public void setCancelled(boolean cancelled)
      Sets whether the event is cancelled or not.
      Specified by:
      setCancelled in interface org.bukkit.event.Cancellable
      Parameters:
      cancelled - Whether the event is cancelled or not.
    • getItemsSold

      public Map<org.bukkit.inventory.ItemStack,Double> getItemsSold()
      Gets the items that were sold.
      Returns:
      The items that were sold.
    • setItemsSold

      public void setItemsSold(Map<org.bukkit.inventory.ItemStack,Double> itemsSold)
      Sets the items that were sold.
      Parameters:
      itemsSold - The items that were sold.
    • getPrice

      public double getPrice()
      Gets the total amount of money earned from the sale.
      Returns:
      The total amount of money earned from the sale.
    • getMultiplier

      public double getMultiplier()
      Gets the multiplier being applied to.
      Returns:
      the multiplier being applied to.
    • setMultiplier

      public void setMultiplier(double multiplier)
      Sets the multiplier being applied to.
      Parameters:
      multiplier - The multiplier being applied to.
    • hasMultiplier

      public boolean hasMultiplier()
      Checks if the event has a multiplier or not.
      Returns:
      Whether the event has a multiplier or not.
    • getShop

      public Shop getShop()
      Gets the shop that the items were sold to.
      Returns:
      The shop that the items were sold to.
    • getBlock

      public org.bukkit.block.Block getBlock()
      Gets the block that the items were sold to.
      Returns:
      The block that the items were sold to.
    • setBlock

      public void setBlock(org.bukkit.block.Block block)
      Sets the block that the items were sold to.
      Parameters:
      block - The block that the items were sold to.