Class ShopBuyEvent

java.lang.Object
org.bukkit.event.Event
com.tomkeuper.bedwars.api.events.shop.ShopBuyEvent
All Implemented Interfaces:
org.bukkit.event.Cancellable

public class ShopBuyEvent extends org.bukkit.event.Event implements org.bukkit.event.Cancellable
Represents an event triggered when a player buys items from the shop.
  • Nested Class Summary

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

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

    Constructors
    Constructor
    Description
    ShopBuyEvent(org.bukkit.entity.Player buyer, IArena arena, ICategoryContent categoryContent, IShopCache shopCache, int slot)
    Creates a new ShopBuyEvent.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the arena where the purchase occurred.
    org.bukkit.entity.Player
    Gets the player who made the purchase.
    Gets the shop category content from which items were bought.
    static org.bukkit.event.HandlerList
    Gets the handler list for this event.
    @NotNull org.bukkit.event.HandlerList
     
    Gets the list of items bought by the player.
    int
    Gets the slot where the purchase was made.
    boolean
    Checks if the event is cancelled.
    void
    setCancelled(boolean cancelled)
    Sets whether the event is cancelled.
    void
    Sets the shop cache for the player

    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

    • ShopBuyEvent

      public ShopBuyEvent(org.bukkit.entity.Player buyer, IArena arena, ICategoryContent categoryContent, IShopCache shopCache, int slot)
      Creates a new ShopBuyEvent.
      Parameters:
      buyer - The player who made the purchase.
      arena - The arena where the purchase occurred.
      categoryContent - The category content from the shop where the purchase was made.
      shopCache - The cache that contains the items bought by the player.
  • Method Details

    • getArena

      public IArena getArena()
      Gets the arena where the purchase occurred.
      Returns:
      The arena.
    • getBuyer

      public org.bukkit.entity.Player getBuyer()
      Gets the player who made the purchase.
      Returns:
      The player.
    • getCategoryContent

      public ICategoryContent getCategoryContent()
      Gets the shop category content from which items were bought.
      Returns:
      The category content.
    • getShopCache

      public IShopCache getShopCache()
      Gets the list of items bought by the player.
      Returns:
      The list of items.
    • setShopCache

      public void setShopCache(IShopCache shopCache)
      Sets the shop cache for the player
      Parameters:
      shopCache - The complete shop cache.
    • getSlot

      public int getSlot()
      Gets the slot where the purchase was made.
      Returns:
      The slot.
    • getHandlers

      @NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()
      Specified by:
      getHandlers in class org.bukkit.event.Event
    • getHandlerList

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

      public boolean isCancelled()
      Checks if the event is cancelled.
      Specified by:
      isCancelled in interface org.bukkit.event.Cancellable
      Returns:
      True if the event is cancelled, otherwise false.
    • setCancelled

      public void setCancelled(boolean cancelled)
      Sets whether the event is cancelled.
      Specified by:
      setCancelled in interface org.bukkit.event.Cancellable
      Parameters:
      cancelled - True to cancel the event, otherwise false.