Interface IPlayerTradeData


  • public interface IPlayerTradeData
    Interface for player trade data (currency and auction claims). Note: If Vault integration is enabled in config, currency operations will use the Vault economy instead of CNPC+ built-in currency.
    • Method Detail

      • getBalance

        long getBalance()
        Get the current balance
        Returns:
        the player's current currency balance
      • setBalance

        void setBalance​(long balance)
        Set the balance directly
        Parameters:
        balance - The new balance
      • deposit

        boolean deposit​(long amount)
        Add currency to balance (deposit)
        Parameters:
        amount - Amount to add
        Returns:
        true if successful, false if would exceed max balance
      • withdraw

        boolean withdraw​(long amount)
        Remove currency from balance (withdraw)
        Parameters:
        amount - Amount to remove
        Returns:
        true if successful, false if insufficient funds
      • canAfford

        boolean canAfford​(long amount)
        Check if player can afford an amount
        Parameters:
        amount - Amount to check
        Returns:
        true if player has enough balance
      • getLifetimeEarned

        long getLifetimeEarned()
        Get lifetime earned currency
        Returns:
        the total currency earned over the player's lifetime
      • getLifetimeSpent

        long getLifetimeSpent()
        Get lifetime spent currency
        Returns:
        the total currency spent over the player's lifetime
      • formatBalance

        String formatBalance()
        Format the balance for display
        Returns:
        the balance formatted as a human-readable string
      • isUsingVault

        boolean isUsingVault()
        Check if Vault is being used for currency operations
        Returns:
        true if Vault is handling currency, false if using CNPC+ built-in
      • getClaimCount

        int getClaimCount()
        Get the number of pending auction claims
        Returns:
        the number of pending auction claims
      • hasClaims

        boolean hasClaims()
        Check if player has any pending auction claims
        Returns:
        true if the player has pending auction claims
      • getClaims

        IAuctionClaim[] getClaims()
        Get all pending auction claims for this player.
        Returns:
        array of the player's pending auction claims
      • getClaim

        IAuctionClaim getClaim​(String claimId)
        Get a specific claim by ID.
        Parameters:
        claimId - The claim ID
        Returns:
        The claim, or null if not found