java.lang.Object
com.olziedev.playerauctions.api.auction.Auction
Direct Known Subclasses:
ARecent

public abstract class Auction extends Object
Represents a player auction that can manage and handle basic data within an auction.
  • Constructor Details

    • Auction

      public Auction()
  • Method Details

    • getID

      public abstract long getID()
      Returns:
      The unique ID of the auction.
    • getUUID

      public abstract UUID getUUID()
      Returns:
      The owner's UUID of this auction.
    • getAuctionPlayer

      public abstract APlayer getAuctionPlayer()
      Returns:
      The owner of this auction.
    • getItem

      public abstract ItemStack getItem()
      Returns:
      The item that is shown to players.
    • getSerializableProduct

      public abstract ASerializableProduct<?> getSerializableProduct()
      Returns:
      The auctioned product.
    • getPrettyItemName

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

      public abstract List<ACategory> 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

      public abstract void setExpireTime(Long expire, Consumer<AuctionResponse> runnable, boolean auto)
      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

      public abstract void setProduct(ASerializableProduct<?> serializableProduct, long amount)
      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

      public abstract ACurrency getCurrency()
      Retrieve the currency for this auction.
      Returns:
      The type of currency that this auction was chosen to use.
    • getAuctionServer

      public abstract String getAuctionServer()
      Returns:
      The server where the auction was created.
    • getWorld

      public abstract String 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

      public abstract void setAuctionPlayer(APlayer auctionPlayer)
      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

      public abstract void addBidder(APlayer auctionPlayer, double price)
      Adds a bidder.
      Parameters:
      auctionPlayer - The bidder.
      price - The offered price.
    • getBidder

      public abstract APlayer 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

      public abstract ItemStack[] getPreviewItems(boolean filter)
      Parameters:
      filter - Should it remove air items from the returned array.
      Returns:
      The array of the preview items for that auction.
    • buy

      public abstract void buy(APlayer buyer, long amount, Runnable runnable)
      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

      public abstract void removeAuction(PlayerAuctionRemoveEvent.Cause cause, Runnable runnable)
      Removes the auction from the server.
      Parameters:
      cause - What caused the auction to be removed for the PlayerAuctionRemoveEvent event.
      runnable - The callback when the method is done.
    • isUnlimited

      public abstract boolean isUnlimited()
      Returns:
      If the auction is unlimited.
    • replaceLore

      public abstract List<String> replaceLore(List<String> s, CommandSender viewer)
      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.