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
ConstructorsConstructorDescriptionShopBuyEvent
(org.bukkit.entity.Player buyer, IArena arena, ICategoryContent categoryContent, IShopCache shopCache, int slot) Creates a new ShopBuyEvent. -
Method Summary
Modifier and TypeMethodDescriptiongetArena()
Gets the arena where the purchase occurred.org.bukkit.entity.Player
getBuyer()
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
getSlot()
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
setShopCache
(IShopCache shopCache) Sets the shop cache for the playerMethods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
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
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
Gets the shop category content from which items were bought.- Returns:
- The category content.
-
getShopCache
Gets the list of items bought by the player.- Returns:
- The list of items.
-
setShopCache
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 classorg.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 interfaceorg.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 interfaceorg.bukkit.event.Cancellable
- Parameters:
cancelled
- True to cancel the event, otherwise false.
-