Class ARecent
java.lang.Object
com.olziedev.playerauctions.api.auction.Auction
com.olziedev.playerauctions.api.auction.recent.ARecent
Represents a recent auction for a player that can manage and handle basic data within the auction.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a bidder.void
Purchases this auction.abstract void
Removes the auction from the players recent.abstract APlayer
abstract ACurrency
Retrieve the currency for this auction.long
abstract long
getID()
abstract ItemStack
getItem()
abstract long
double
abstract String
getPrettyItemName
(boolean showDisplayName) abstract ItemStack[]
getPreviewItems
(boolean filter) abstract double
getPrice()
abstract RecentAuctionType
getType()
boolean
boolean
void
removeAuction
(PlayerAuctionRemoveEvent.Cause cause, Runnable runnable) Removes the auction from the server.void
setAuctionPlayer
(APlayer auctionPlayer) Modifies the auction owner.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.Methods inherited from class com.olziedev.playerauctions.api.auction.Auction
getAuctionDate, getAuctionServer, getBuyPrice, getRandomSort, getSerializableProduct, getUUID, getWorld, isUnlimited, replaceLore, setRandomSort
-
Constructor Details
-
ARecent
public ARecent()
-
-
Method Details
-
getID
public abstract long getID() -
getPrice
public abstract double getPrice() -
getCurrency
Retrieve the currency for this auction.- Specified by:
getCurrency
in classAuction
- Returns:
- The type of currency that this auction was chosen to use.
-
getAuctionPlayer
- Specified by:
getAuctionPlayer
in classAuction
- Returns:
- The owner of this auction.
-
getItem
-
getPrettyItemName
- Specified by:
getPrettyItemName
in classAuction
- Parameters:
showDisplayName
- If item has a display name, it'll return the item name. (coloured)- Returns:
- The pretty item name.
-
getType
- Returns:
- The type of recent the auction is.
-
getItemAmount
public abstract long getItemAmount()- Specified by:
getItemAmount
in classAuction
- Returns:
- The amount of items that the auction has.
-
setProduct
Modifies the item stack of the auction.- Specified by:
setProduct
in classAuction
- Parameters:
serializableProduct
- The product of the auction.amount
- The amount for the auction item.
-
setPrice
public abstract void setPrice(double price) -
deleteAuction
public abstract void deleteAuction()Removes the auction from the players recent. -
getPreviewItems
- Specified by:
getPreviewItems
in classAuction
- Parameters:
filter
- Should it remove air items from the returned array.- Returns:
- The array of the preview items for that auction.
-
getOriginalPrice
public double getOriginalPrice()- Specified by:
getOriginalPrice
in classAuction
- Returns:
- The price it was originally sold as, before the plugin modified the value.
-
getAuctionCategories
- Specified by:
getAuctionCategories
in classAuction
- Returns:
- The categories of this auction based off the item.
-
getExpireTime
public long getExpireTime()- Specified by:
getExpireTime
in classAuction
- Returns:
- The time when the auction will expire in milliseconds.
-
hasExpired
public boolean hasExpired()- Specified by:
hasExpired
in classAuction
- Returns:
- If the auction has expired.
-
setExpireTime
Description copied from class:Auction
Modifies the expiry time when the auction should expire.- Specified by:
setExpireTime
in classAuction
- 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.
-
setAuctionPlayer
Description copied from class:Auction
Modifies the auction owner.- Specified by:
setAuctionPlayer
in classAuction
- Parameters:
auctionPlayer
- The new auction owner.
-
isBidding
public boolean isBidding() -
addBidder
Description copied from class:Auction
Adds a bidder. -
getBidder
-
buy
Description copied from class:Auction
Purchases this auction. -
removeAuction
Description copied from class:Auction
Removes the auction from the server.- Specified by:
removeAuction
in classAuction
- Parameters:
cause
- What caused the auction to be removed for thePlayerAuctionRemoveEvent
event.runnable
- The callback when the method is done.
-