Class SignSellEvent

java.lang.Object
org.bukkit.event.Event
com.vk2gpz.autosell.event.SignSellEvent

public class SignSellEvent extends org.bukkit.event.Event
This event is called when a player sells items to a sign. 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
    SignSellEvent(org.bukkit.entity.Player player, List<org.bukkit.inventory.ItemStack> sold, int totalItems, double totalCost, double multiplier, Shop shop)
    Creates a new SignSellEvent.
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.bukkit.event.HandlerList
    Gets the list of handlers for this event.
    @NotNull org.bukkit.event.HandlerList
    Gets the list of handlers for this event.
    List<org.bukkit.inventory.ItemStack>
    Gets the list of items sold.
    double
    Gets the multiplier for the sale.
    Gets the name of the player.
    org.bukkit.entity.Player
    Gets the player who sold the items.
    Gets the shop that the items were sold to.
    double
    Gets the total amount of money earned from the sale.
    int
    Gets the number of items sold.
    boolean
    Checks if there is a multiplier to be applied to.
    void
    setTotalCost(double totalCost)
    Sets the total amount of money earned from the sale.
    void
    setTotalItems(int totalItems)
    Sets the number of items sold.

    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

    • SignSellEvent

      public SignSellEvent(org.bukkit.entity.Player player, List<org.bukkit.inventory.ItemStack> sold, int totalItems, double totalCost, double multiplier, Shop shop)
      Creates a new SignSellEvent.
      Parameters:
      player - The player who sold the items.
      sold - The items that were sold.
      totalItems - The number of items sold.
      totalCost - The total amount of money earned from the sale.
      multiplier - The multiplier for the sale.
      shop - The shop that the items were sold to.
  • Method Details

    • getName

      public String getName()
      Gets the name of the player.
      Returns:
      The name of the player.
    • 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 list of handlers for this event.
      Specified by:
      getHandlers in class org.bukkit.event.Event
      Returns:
      the list of handlers for this event.
    • getHandlerList

      public static org.bukkit.event.HandlerList getHandlerList()
      Gets the list of handlers for this event.
      Returns:
      the list of handlers for this event.
    • getItemsSold

      public List<org.bukkit.inventory.ItemStack> getItemsSold()
      Gets the list of items sold.
      Returns:
      The list of items sold.
    • setTotalItems

      public void setTotalItems(int totalItems)
      Sets the number of items sold.
      Parameters:
      totalItems -
    • getTotalItems

      public int getTotalItems()
      Gets the number of items sold.
      Returns:
      The number of items sold.
    • setTotalCost

      public void setTotalCost(double totalCost)
      Sets the total amount of money earned from the sale.
      Parameters:
      totalCost - The total amount of money earned from the sale.
    • getTotalCost

      public double getTotalCost()
      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 for the sale.
      Returns:
      the multiplier for the sale.
    • hasMultiplier

      public boolean hasMultiplier()
      Checks if there is a multiplier to be applied to.
      Returns:
      Whether there is a multiplier to be applied to.
    • getShop

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