Class Auction
java.lang.Object
com.olziedev.playerauctions.api.auction.Auction
- Direct Known Subclasses:
ARecent
Represents a player auction that can manage and handle basic data within an auction.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
Adds a bidder.abstract void
Purchases this auction.abstract long
abstract APlayer
abstract String
abstract APlayer
abstract double
getBuyPrice
(long amount) abstract ACurrency
Retrieve the currency for this auction.abstract long
abstract long
getID()
abstract ItemStack
getItem()
abstract long
abstract double
abstract String
getPrettyItemName
(boolean showDisplayName) abstract ItemStack[]
getPreviewItems
(boolean filter) abstract double
getPrice()
abstract long
abstract ASerializableProduct<?>
abstract UUID
getUUID()
abstract String
getWorld()
abstract boolean
abstract boolean
abstract boolean
abstract void
removeAuction
(PlayerAuctionRemoveEvent.Cause cause, Runnable runnable) Removes the auction from the server.replaceLore
(List<String> s, CommandSender viewer) abstract void
setAuctionPlayer
(APlayer auctionPlayer) Modifies the auction owner.abstract void
setExpireTime
(Long expire, Consumer<AuctionResponse> runnable, boolean auto) Modifies the expiry time when the auction should expire.abstract void
setPrice
(double price) abstract void
setProduct
(ASerializableProduct<?> serializableProduct, long amount) Modifies the item stack of the auction.abstract void
setRandomSort
(long randomSort) Sets the random sort ID of this auction.
-
Constructor Details
-
Auction
public Auction()
-
-
Method Details
-
getID
public abstract long getID()- Returns:
- The unique ID of the auction.
-
getUUID
- Returns:
- The owner's UUID of this auction.
-
getAuctionPlayer
- Returns:
- The owner of this auction.
-
getItem
- Returns:
- The item that is shown to players.
-
getSerializableProduct
- Returns:
- The auctioned product.
-
getPrettyItemName
- Parameters:
showDisplayName
- If item has a display name, it'll return the item name. (coloured)- Returns:
- The pretty item name.
-
getAuctionCategories
- Returns:
- The categories of this auction based off the item.
-
getExpireTime
public abstract long getExpireTime()- Returns:
- The time when the auction will expire in milliseconds.
-
getAuctionDate
public abstract long getAuctionDate()- Returns:
- The creation date of this auction in milliseconds.
-
hasExpired
public abstract boolean hasExpired()- Returns:
- If the auction has expired.
-
setExpireTime
Modifies the expiry time when the auction should expire.- Parameters:
expire
- The amount of time the auction should expire.runnable
- The callback when the method is done.auto
- If the auction timer has used this method.
-
getItemAmount
public abstract long getItemAmount()- Returns:
- The amount of items that the auction has.
-
setProduct
Modifies the item stack of the auction.- Parameters:
serializableProduct
- The product of the auction.amount
- The amount for the auction item.
-
getPrice
public abstract double getPrice()- Returns:
- The current amount of the auction cost.
-
getOriginalPrice
public abstract double getOriginalPrice()- Returns:
- The price it was originally sold as, before the plugin modified the value.
-
getCurrency
Retrieve the currency for this auction.- Returns:
- The type of currency that this auction was chosen to use.
-
getAuctionServer
- Returns:
- The server where the auction was created.
-
getWorld
- Returns:
- The name of the world the warp is located in.
-
setPrice
public abstract void setPrice(double price) - Parameters:
price
- The amount the auction should cost.
-
setAuctionPlayer
Modifies the auction owner.- Parameters:
auctionPlayer
- The new auction owner.
-
isBidding
public abstract boolean isBidding()- Returns:
- If the auction is a bid or not.
-
addBidder
Adds a bidder.- Parameters:
auctionPlayer
- The bidder.price
- The offered price.
-
getBidder
- Returns:
- The current bidder that has offered the most.
-
getBuyPrice
public abstract double getBuyPrice(long amount) - Parameters:
amount
- The amount of items to get the price of- Returns:
- The price of all the items
-
getPreviewItems
- Parameters:
filter
- Should it remove air items from the returned array.- Returns:
- The array of the preview items for that auction.
-
buy
Purchases this auction.- Parameters:
buyer
- The buyer.amount
- The amount of items the player wants to buy.runnable
- The callback when the method is done.
-
getRandomSort
public abstract long getRandomSort()- Returns:
- The random sort ID of this auction.
-
setRandomSort
public abstract void setRandomSort(long randomSort) Sets the random sort ID of this auction.- Parameters:
randomSort
- The new random sort ID of this auction.
-
removeAuction
Removes the auction from the server.- Parameters:
cause
- What caused the auction to be removed for thePlayerAuctionRemoveEvent
event.runnable
- The callback when the method is done.
-
isUnlimited
public abstract boolean isUnlimited()- Returns:
- If the auction is unlimited.
-
replaceLore
- Parameters:
s
- The string that will be replaced with the needed variables.viewer
- The sender that is viewing the auction.- Returns:
- The new string with the new variables.
-