Package com.vk2gpz.autosell.event
Class SellAllEvent
java.lang.Object
org.bukkit.event.Event
com.vk2gpz.autosell.event.SellAllEvent
public class SellAllEvent
extends org.bukkit.event.Event
This event is called when a player sells all items in their inventory.
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
ConstructorsConstructorDescriptionSellAllEvent
(org.bukkit.entity.Player player, List<org.bukkit.inventory.ItemStack> sold, int totalItems, double totalCost, double multiplier, Shop shop) Creates a new SellAllEvent. -
Method Summary
Modifier and TypeMethodDescriptionstatic org.bukkit.event.HandlerList
Gets the handler list for this event.@NotNull org.bukkit.event.HandlerList
Gets the handler list for this event.List
<org.bukkit.inventory.ItemStack> Gets the list of items that were sold.double
Gets the multiplier for the sale.getName()
Gets the player who sold the items.org.bukkit.entity.Player
Gets the player who sold the items.getShop()
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 the multiplier exists for this sale.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
-
Constructor Details
-
SellAllEvent
public SellAllEvent(org.bukkit.entity.Player player, List<org.bukkit.inventory.ItemStack> sold, int totalItems, double totalCost, double multiplier, Shop shop) Creates a new SellAllEvent.- 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
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 classorg.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.
-
getItemsSold
Gets the list of items that were sold.- Returns:
- The list of items that were sold.
-
setTotalItems
public void setTotalItems(int totalItems) Sets the number of items sold.- Parameters:
totalItems
- The number of items sold.
-
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 the multiplier exists for this sale.- Returns:
- Whether the multiplier exists for this sale.
-
getShop
Gets the shop that the items were sold to.- Returns:
- The shop that the items were sold to.
-