Package noppes.npcs.api.handler
Interface IPlayerTradeData
-
public interface IPlayerTradeDataInterface 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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancanAfford(long amount)Check if player can afford an amountbooleandeposit(long amount)Add currency to balance (deposit)StringformatBalance()Format the balance for displaylonggetBalance()Get the current balanceIAuctionClaimgetClaim(String claimId)Get a specific claim by ID.intgetClaimCount()Get the number of pending auction claimsIAuctionClaim[]getClaims()Get all pending auction claims for this player.longgetLifetimeEarned()Get lifetime earned currencylonggetLifetimeSpent()Get lifetime spent currencybooleanhasClaims()Check if player has any pending auction claimsbooleanisUsingVault()Check if Vault is being used for currency operationsvoidsetBalance(long balance)Set the balance directlybooleanwithdraw(long amount)Remove currency from balance (withdraw)
-
-
-
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
-
-