Interface IAuctionHandler


  • public interface IAuctionHandler
    Handler for the Auction system. Access via API.getAuctions()
    • Method Detail

      • isEnabled

        boolean isEnabled()
        Check if the auction system is enabled.
        Returns:
        true if the auction system is enabled
      • getActiveListings

        IAuctionListing[] getActiveListings()
        Get all active listings.
        Returns:
        array of all currently active auction listings
      • getListing

        IAuctionListing getListing​(String listingId)
        Get a specific listing by ID.
        Parameters:
        listingId - The listing ID
        Returns:
        The listing, or null if not found
      • getListingsBySeller

        IAuctionListing[] getListingsBySeller​(String sellerUUID)
        Get all active listings by a specific seller.
        Parameters:
        sellerUUID - The seller's UUID as a string
        Returns:
        array of listings created by this seller
      • getListingsByBidder

        IAuctionListing[] getListingsByBidder​(String bidderUUID)
        Get all listings where a player is the current high bidder.
        Parameters:
        bidderUUID - The bidder's UUID as a string
        Returns:
        array of listings this player has bid on
      • getActiveListingCount

        int getActiveListingCount()
        Get total count of active listings.
        Returns:
        the number of currently active listings
      • createListing

        IAuctionListing createListing​(IPlayer<?> player,
                                      IItemStack item,
                                      long startingPrice,
                                      long buyoutPrice)
        Create a new listing.
        Parameters:
        player - The seller
        item - The item to sell
        startingPrice - The starting bid price
        buyoutPrice - The buyout price (0 for no buyout)
        Returns:
        The created listing, or null if failed
      • placeBid

        String placeBid​(String listingId,
                        IPlayer<?> player,
                        long amount)
        Place a bid on a listing.
        Parameters:
        listingId - The listing ID
        player - The bidder
        amount - The bid amount
        Returns:
        null on success, error message on failure
      • buyout

        String buyout​(String listingId,
                      IPlayer<?> player)
        Buyout a listing instantly.
        Parameters:
        listingId - The listing ID
        player - The buyer
        Returns:
        null on success, error message on failure
      • cancelListing

        String cancelListing​(String listingId,
                             IPlayer<?> player,
                             boolean isAdmin)
        Cancel a listing (seller only, unless admin).
        Parameters:
        listingId - The listing ID
        player - The player cancelling
        isAdmin - Whether to bypass ownership check
        Returns:
        null on success, error message on failure
      • getListingFee

        long getListingFee()
        Get the listing fee amount.
        Returns:
        the currency fee charged when creating a listing
      • getSalesTaxPercent

        double getSalesTaxPercent()
        Get the sales tax percentage (0.0 to 1.0).
        Returns:
        the sales tax percentage applied to completed sales
      • getMinBidIncrementPercent

        double getMinBidIncrementPercent()
        Get the minimum bid increment percentage (0.0 to 1.0).
        Returns:
        the minimum bid increment as a percentage of current bid
      • getAuctionDurationHours

        int getAuctionDurationHours()
        Get the auction duration in hours.
        Returns:
        the default auction duration in hours
      • getSnipeProtectionMinutes

        int getSnipeProtectionMinutes()
        Get the snipe protection time in minutes.
        Returns:
        the snipe protection window in minutes
      • getCurrencyName

        String getCurrencyName()
        Get the currency name used by the auction system.
        Returns:
        the display name of the auction currency
      • getMinimumListingPrice

        long getMinimumListingPrice()
        Get the minimum listing price.
        Returns:
        the minimum starting price for new listings
      • searchListings

        IAuctionListing[] searchListings​(String searchText)
        Search listings by item name or seller name.
        Parameters:
        searchText - The search text
        Returns:
        Matching active listings
      • save

        void save()
        Force save auction data.