Package com.vk2gpz.autosell.event
Class AutoSellAnnounceEvent
java.lang.Object
org.bukkit.event.Event
com.vk2gpz.autosell.event.AutoSellAnnounceEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
public class AutoSellAnnounceEvent
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
ConstructorsConstructorDescriptionAutoSellAnnounceEvent(org.bukkit.entity.Player player, double total, int amountOfItemsSold) Creates a new AutoSellAnnounceEvent. -
Method Summary
Modifier and TypeMethodDescriptionintGets the number of items sold.static org.bukkit.event.HandlerListGets the handler list for this event.@NotNull org.bukkit.event.HandlerListGets the handler list for this event.org.bukkit.entity.PlayerGets the player who sold the items.doublegetTotal()Gets the total amount of money earned from the sale.booleanGets whether the event is cancelled or not.voidsetAmountOfItemsSold(int amountOfItemsSold) Sets the number of items sold.voidsetCancelled(boolean cancelled) Sets whether the event is cancelled or not.voidsetTotal(double total) Sets the total amount of money earned from the sale.Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
AutoSellAnnounceEvent
public AutoSellAnnounceEvent(org.bukkit.entity.Player player, double total, int amountOfItemsSold) Creates a new AutoSellAnnounceEvent.- Parameters:
player- The player who sold the items.total- The total amount of money earned from the sale.amountOfItemsSold- The number of items sold.
-
-
Method Details
-
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.
-
getTotal
public double getTotal()Gets the total amount of money earned from the sale.- Returns:
- The total amount of money earned from the sale.
-
setTotal
public void setTotal(double total) Sets the total amount of money earned from the sale.- Parameters:
total- The total amount of money earned from the sale.
-
getAmountOfItemsSold
public int getAmountOfItemsSold()Gets the number of items sold.- Returns:
- The number of items sold.
-
setAmountOfItemsSold
public void setAmountOfItemsSold(int amountOfItemsSold) Sets the number of items sold.- Parameters:
amountOfItemsSold- The number of items sold.
-
isCancelled
public boolean isCancelled()Gets whether 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.
-