java.lang.Object
com.olziedev.playerauctions.api.auction.Auction
com.olziedev.playerauctions.api.auction.recent.ARecent

public abstract class ARecent extends Auction
Represents a recent auction for a player that can manage and handle basic data within the auction.
  • Constructor Details

    • ARecent

      public ARecent()
  • Method Details

    • getID

      public abstract long getID()
      Specified by:
      getID in class Auction
      Returns:
      The unique ID of the auction.
    • getPrice

      public abstract double getPrice()
      Specified by:
      getPrice in class Auction
      Returns:
      The current amount of the auction cost.
    • getCurrency

      public abstract ACurrency getCurrency()
      Retrieve the currency for this auction.
      Specified by:
      getCurrency in class Auction
      Returns:
      The type of currency that this auction was chosen to use.
    • getAuctionPlayer

      public abstract APlayer getAuctionPlayer()
      Specified by:
      getAuctionPlayer in class Auction
      Returns:
      The owner of this auction.
    • getItem

      public abstract ItemStack getItem()
      Specified by:
      getItem in class Auction
      Returns:
      The auctioned item.
    • getPrettyItemName

      public abstract String getPrettyItemName(boolean showDisplayName)
      Specified by:
      getPrettyItemName in class Auction
      Parameters:
      showDisplayName - If item has a display name, it'll return the item name. (coloured)
      Returns:
      The pretty item name.
    • getType

      public abstract RecentAuctionType getType()
      Returns:
      The type of recent the auction is.
    • getItemAmount

      public abstract long getItemAmount()
      Specified by:
      getItemAmount in class Auction
      Returns:
      The amount of items that the auction has.
    • setProduct

      public abstract void setProduct(ASerializableProduct<?> serializableProduct, long amount)
      Modifies the item stack of the auction.
      Specified by:
      setProduct in class Auction
      Parameters:
      serializableProduct - The product of the auction.
      amount - The amount for the auction item.
    • setPrice

      public abstract void setPrice(double price)
      Specified by:
      setPrice in class Auction
      Parameters:
      price - The amount the auction should cost.
    • deleteAuction

      public abstract void deleteAuction()
      Removes the auction from the players recent.
    • getPreviewItems

      public abstract ItemStack[] getPreviewItems(boolean filter)
      Specified by:
      getPreviewItems in class Auction
      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 class Auction
      Returns:
      The price it was originally sold as, before the plugin modified the value.
    • getAuctionCategories

      public List<ACategory> getAuctionCategories()
      Specified by:
      getAuctionCategories in class Auction
      Returns:
      The categories of this auction based off the item.
    • getExpireTime

      public long getExpireTime()
      Specified by:
      getExpireTime in class Auction
      Returns:
      The time when the auction will expire in milliseconds.
    • hasExpired

      public boolean hasExpired()
      Specified by:
      hasExpired in class Auction
      Returns:
      If the auction has expired.
    • setExpireTime

      public void setExpireTime(Long expire, Consumer<AuctionResponse> runnable, boolean auto)
      Description copied from class: Auction
      Modifies the expiry time when the auction should expire.
      Specified by:
      setExpireTime in class Auction
      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

      public void setAuctionPlayer(APlayer auctionPlayer)
      Description copied from class: Auction
      Modifies the auction owner.
      Specified by:
      setAuctionPlayer in class Auction
      Parameters:
      auctionPlayer - The new auction owner.
    • isBidding

      public boolean isBidding()
      Specified by:
      isBidding in class Auction
      Returns:
      If the auction is a bid or not.
    • addBidder

      public void addBidder(APlayer auctionPlayer, double price)
      Description copied from class: Auction
      Adds a bidder.
      Specified by:
      addBidder in class Auction
      Parameters:
      auctionPlayer - The bidder.
      price - The offered price.
    • getBidder

      public APlayer getBidder()
      Specified by:
      getBidder in class Auction
      Returns:
      The current bidder that has offered the most.
    • buy

      public void buy(APlayer buyer, long amount, Runnable runnable)
      Description copied from class: Auction
      Purchases this auction.
      Specified by:
      buy in class Auction
      Parameters:
      buyer - The buyer.
      amount - The amount of items the player wants to buy.
      runnable - The callback when the method is done.
    • removeAuction

      public void removeAuction(PlayerAuctionRemoveEvent.Cause cause, Runnable runnable)
      Description copied from class: Auction
      Removes the auction from the server.
      Specified by:
      removeAuction in class Auction
      Parameters:
      cause - What caused the auction to be removed for the PlayerAuctionRemoveEvent event.
      runnable - The callback when the method is done.