Class SellEvent
java.lang.Object
org.bukkit.event.Event
io.eliotesta98.CubeGenerator.Events.ApiEvents.SellEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable,org.bukkit.event.Listener
public class SellEvent
extends org.bukkit.event.Event
implements org.bukkit.event.Cancellable, org.bukkit.event.Listener
This Event is invoked when a generator sell the items in interface
- See Also:
-
CancellableListenerEvent
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn the compatibility used for sale.
Possible values: Default or ShopGuiPlus.static org.bukkit.event.HandlerListEvent Listorg.bukkit.event.HandlerListEvent ListArrayList<org.bukkit.inventory.ItemStack>Returns the list of items used for sale.
ATTENTION!doublegetPrice()Return the final price of sale calculated.Return the reason of sale.
Possible reasons: Button Sell or AutoSell.org.bukkit.entity.PlayerReturns the player who made the sale.booleanCancelled event controlvoidsetCancelled(boolean isCancelled) Set on true if you want event to be cancelledvoidsetPrice(double newPrice) Set the total price you want use for sale.Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
SellEvent
public SellEvent(String compatibility, String reason, org.bukkit.entity.Player seller, double price, ArrayList<org.bukkit.inventory.ItemStack> itemsToSell) Constructor- Parameters:
compatibility- if you want a specific compatibility used from pluginreason- if you want a reason for sale eventseller- player who sell the items in Cubeprice- price of saleitemsToSell- list of items to sale
-
-
Method Details
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList()Event List- Returns:
- a list of events
-
getHandlers
public org.bukkit.event.HandlerList getHandlers()Event List- Specified by:
getHandlersin classorg.bukkit.event.Event- Returns:
- a list of events
-
isCancelled
public boolean isCancelled()Cancelled event control- Specified by:
isCancelledin interfaceorg.bukkit.event.Cancellable- Returns:
- if event is cancelled
-
setCancelled
public void setCancelled(boolean isCancelled) Set on true if you want event to be cancelled- Specified by:
setCancelledin interfaceorg.bukkit.event.Cancellable
-
getReason
Return the reason of sale.
Possible reasons: Button Sell or AutoSell.- Returns:
- the reason of sale.
-
getPrice
public double getPrice()Return the final price of sale calculated.- Returns:
- the price of sale.
-
setPrice
public void setPrice(double newPrice) Set the total price you want use for sale.- Parameters:
newPrice- the price of sale.
-
getCompatibility
Return the compatibility used for sale.
Possible values: Default or ShopGuiPlus.- Returns:
- the compatibility used.
-
getSeller
public org.bukkit.entity.Player getSeller()Returns the player who made the sale.- Returns:
- the seller.
-
getItemsToSell
Returns the list of items used for sale.
ATTENTION! This list contains all item of a specific generator not only that will be sold- Returns:
- the list of items.
-