java.lang.Object
org.bukkit.event.Event
io.eliotesta98.CubeGenerator.Events.ApiEvents.SellEvent
All Implemented Interfaces:
org.bukkit.event.Cancellable, org.bukkit.event.Listener

public class SellEvent extends org.bukkit.event.Event implements org.bukkit.event.Cancellable, org.bukkit.event.Listener
This Event is invoked when a generator sell the items in interface
See Also:
  • Cancellable
  • Listener
  • Event
  • Nested Class Summary

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

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

    Constructors
    Constructor
    Description
    SellEvent(String compatibility, String reason, org.bukkit.entity.Player seller, double price, ArrayList<org.bukkit.inventory.ItemStack> itemsToSell)
    Constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    Return the compatibility used for sale.
    Possible values: Default or ShopGuiPlus.
    static org.bukkit.event.HandlerList
    Event List
    org.bukkit.event.HandlerList
    Event List
    ArrayList<org.bukkit.inventory.ItemStack>
    Returns the list of items used for sale.
    ATTENTION!
    double
    Return the final price of sale calculated.
    Return the reason of sale.
    Possible reasons: Button Sell or AutoSell.
    org.bukkit.entity.Player
    Returns the player who made the sale.
    boolean
    Cancelled event control
    void
    setCancelled(boolean isCancelled)
    Set on true if you want event to be cancelled
    void
    setPrice(double newPrice)
    Set the total price you want use for sale.

    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

    • SellEvent

      public SellEvent(String compatibility, String reason, org.bukkit.entity.Player seller, double price, ArrayList<org.bukkit.inventory.ItemStack> itemsToSell)
      Constructor
      Parameters:
      compatibility - if you want a specific compatibility used from plugin
      reason - if you want a reason for sale event
      seller - player who sell the items in Cube
      price - price of sale
      itemsToSell - list of items to sale
  • Method Details

    • getHandlerList

      public static org.bukkit.event.HandlerList getHandlerList()
      Event List
      Returns:
      a list of events
    • getHandlers

      public org.bukkit.event.HandlerList getHandlers()
      Event List
      Specified by:
      getHandlers in class org.bukkit.event.Event
      Returns:
      a list of events
    • isCancelled

      public boolean isCancelled()
      Cancelled event control
      Specified by:
      isCancelled in interface org.bukkit.event.Cancellable
      Returns:
      if event is cancelled
    • setCancelled

      public void setCancelled(boolean isCancelled)
      Set on true if you want event to be cancelled
      Specified by:
      setCancelled in interface org.bukkit.event.Cancellable
    • getReason

      public String getReason()
      Return the reason of sale.
      Possible reasons: Button Sell or AutoSell.
      Returns:
      the reason of sale.
    • getPrice

      public double getPrice()
      Return the final price of sale calculated.
      Returns:
      the price of sale.
    • setPrice

      public void setPrice(double newPrice)
      Set the total price you want use for sale.
      Parameters:
      newPrice - the price of sale.
    • getCompatibility

      public String getCompatibility()
      Return the compatibility used for sale.
      Possible values: Default or ShopGuiPlus.
      Returns:
      the compatibility used.
    • getSeller

      public org.bukkit.entity.Player getSeller()
      Returns the player who made the sale.
      Returns:
      the seller.
    • getItemsToSell

      public ArrayList<org.bukkit.inventory.ItemStack> getItemsToSell()
      Returns the list of items used for sale.
      ATTENTION! This list contains all item of a specific generator not only that will be sold
      Returns:
      the list of items.