Package com.vk2gpz.autosell.event
Class AutoSellEvent
java.lang.Object
org.bukkit.event.Event
com.vk2gpz.autosell.event.AutoSellEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
public class AutoSellEvent
extends org.bukkit.event.Event
implements org.bukkit.event.Cancellable
This event is called when a player sells items automatically.
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
ConstructorsConstructorDescriptionAutoSellEvent(org.bukkit.entity.Player player, Map<org.bukkit.inventory.ItemStack, Double> itemsSold, double multiplier, Shop shop, org.bukkit.block.Block block) Creates a new AutoSellEvent. -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.block.BlockgetBlock()Gets the block that the items were sold to.static org.bukkit.event.HandlerListGets the handler list for this event.@NotNull org.bukkit.event.HandlerListGets the handler list for this event.Gets the items that were sold.doubleGets the multiplier being applied to.getName()Gets the player who sold the items.org.bukkit.entity.PlayerGets the player who sold the items.doublegetPrice()Gets the total amount of money earned from the sale.getShop()Gets the shop that the items were sold to.booleanChecks if the event has a multiplier or not.booleanChecks if the event is cancelled or not.voidsetBlock(org.bukkit.block.Block block) Sets the block that the items were sold to.voidsetCancelled(boolean cancelled) Sets whether the event is cancelled or not.voidsetItemsSold(Map<org.bukkit.inventory.ItemStack, Double> itemsSold) Sets the items that were sold.voidsetMultiplier(double multiplier) Sets the multiplier being applied to.Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
AutoSellEvent
public AutoSellEvent(org.bukkit.entity.Player player, Map<org.bukkit.inventory.ItemStack, Double> itemsSold, double multiplier, Shop shop, org.bukkit.block.Block block) Creates a new AutoSellEvent.- Parameters:
player- The player who sold the items.itemsSold- The items that were sold.multiplier- The multiplier for the sale.shop- The shop that the items were sold to.block- The block 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:
getHandlersin 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.
-
isCancelled
public boolean isCancelled()Checks if the event is cancelled or not.- Specified by:
isCancelledin interfaceorg.bukkit.event.Cancellable- Returns:
- Whether the event is cancelled or not.
-
setCancelled
public void setCancelled(boolean cancelled) Sets whether the event is cancelled or not.- Specified by:
setCancelledin interfaceorg.bukkit.event.Cancellable- Parameters:
cancelled- Whether the event is cancelled or not.
-
getItemsSold
Gets the items that were sold.- Returns:
- The items that were sold.
-
setItemsSold
Sets the items that were sold.- Parameters:
itemsSold- The items that were sold.
-
getPrice
public double getPrice()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 being applied to.- Returns:
- the multiplier being applied to.
-
setMultiplier
public void setMultiplier(double multiplier) Sets the multiplier being applied to.- Parameters:
multiplier- The multiplier being applied to.
-
hasMultiplier
public boolean hasMultiplier()Checks if the event has a multiplier or not.- Returns:
- Whether the event has a multiplier or not.
-
getShop
Gets the shop that the items were sold to.- Returns:
- The shop that the items were sold to.
-
getBlock
public org.bukkit.block.Block getBlock()Gets the block that the items were sold to.- Returns:
- The block that the items were sold to.
-
setBlock
public void setBlock(org.bukkit.block.Block block) Sets the block that the items were sold to.- Parameters:
block- The block that the items were sold to.
-