mirror of
https://github.com/KAMKEEL/CustomNPC-Plus-API.git
synced 2026-11-17 20:25:15 +00:00
Auction and Currency API
This commit is contained in:
1 parent
c8a2fb9824
commit
2e5d86993c
6 files changed
+383
-4
No files matched your search
@@ -0,0 +1,99 @@
|
||||
package noppes.npcs.api.handler.data;
|
||||
|
||||
import noppes.npcs.api.item.IItemStack;
|
||||
|
||||
/**
|
||||
* Represents an auction claim (item or currency to be collected).
|
||||
*/
|
||||
public interface IAuctionClaim {
|
||||
|
||||
/**
|
||||
* Get the unique claim ID.
|
||||
*/
|
||||
String getId();
|
||||
|
||||
/**
|
||||
* Get the player's UUID who can claim this.
|
||||
*/
|
||||
String getPlayerUUID();
|
||||
|
||||
/**
|
||||
* Get the player's display name.
|
||||
*/
|
||||
String getPlayerName();
|
||||
|
||||
/**
|
||||
* Get the related listing ID.
|
||||
*/
|
||||
String getListingId();
|
||||
|
||||
/**
|
||||
* Get the claim type.
|
||||
* @return 0 = Item, 1 = Currency (sale proceeds), 2 = Refund (outbid)
|
||||
*/
|
||||
int getType();
|
||||
|
||||
/**
|
||||
* Check if this is an item claim.
|
||||
*/
|
||||
boolean isItemClaim();
|
||||
|
||||
/**
|
||||
* Check if this is a currency claim (sale proceeds or refund).
|
||||
*/
|
||||
boolean isCurrencyClaim();
|
||||
|
||||
/**
|
||||
* Check if this is a refund claim (outbid).
|
||||
*/
|
||||
boolean isRefundClaim();
|
||||
|
||||
/**
|
||||
* Get the item to claim (for item claims only).
|
||||
* @return The item, or null for currency claims
|
||||
*/
|
||||
IItemStack getItem();
|
||||
|
||||
/**
|
||||
* Get the item display name (for currency/refund claims tooltip).
|
||||
*/
|
||||
String getItemName();
|
||||
|
||||
/**
|
||||
* Get the currency amount (for currency/refund claims).
|
||||
*/
|
||||
long getCurrency();
|
||||
|
||||
/**
|
||||
* Get the other player's name involved.
|
||||
* For currency claims: the buyer's name.
|
||||
* For refund claims: the player who outbid.
|
||||
*/
|
||||
String getOtherPlayerName();
|
||||
|
||||
/**
|
||||
* Get when this claim was created (Unix timestamp in ms).
|
||||
*/
|
||||
long getCreatedTime();
|
||||
|
||||
/**
|
||||
* Check if this claim has been claimed.
|
||||
*/
|
||||
boolean isClaimed();
|
||||
|
||||
/**
|
||||
* Check if this is a returned item (expired/cancelled listing) vs won item.
|
||||
* Only relevant for item claims.
|
||||
*/
|
||||
boolean isReturnedItem();
|
||||
|
||||
/**
|
||||
* Get days until this claim expires.
|
||||
*/
|
||||
long getDaysUntilExpiration();
|
||||
|
||||
/**
|
||||
* Check if this claim has expired.
|
||||
*/
|
||||
boolean isExpired();
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
package noppes.npcs.api.handler.data;
|
||||
|
||||
import noppes.npcs.api.item.IItemStack;
|
||||
|
||||
/**
|
||||
* Represents an auction listing.
|
||||
*/
|
||||
public interface IAuctionListing {
|
||||
|
||||
/**
|
||||
* Get the unique listing ID.
|
||||
*/
|
||||
String getId();
|
||||
|
||||
/**
|
||||
* Get the seller's UUID as a string.
|
||||
*/
|
||||
String getSellerUUID();
|
||||
|
||||
/**
|
||||
* Get the seller's display name.
|
||||
*/
|
||||
String getSellerName();
|
||||
|
||||
/**
|
||||
* Get the item being sold.
|
||||
*/
|
||||
IItemStack getItem();
|
||||
|
||||
/**
|
||||
* Get the starting price.
|
||||
*/
|
||||
long getStartingPrice();
|
||||
|
||||
/**
|
||||
* Get the buyout price (0 if no buyout).
|
||||
*/
|
||||
long getBuyoutPrice();
|
||||
|
||||
/**
|
||||
* Check if this listing has a buyout option.
|
||||
*/
|
||||
boolean hasBuyout();
|
||||
|
||||
/**
|
||||
* Get the current highest bid.
|
||||
*/
|
||||
long getCurrentBid();
|
||||
|
||||
/**
|
||||
* Get the high bidder's UUID as a string (null if no bids).
|
||||
*/
|
||||
String getHighBidderUUID();
|
||||
|
||||
/**
|
||||
* Get the high bidder's display name (null if no bids).
|
||||
*/
|
||||
String getHighBidderName();
|
||||
|
||||
/**
|
||||
* Check if there are any bids on this listing.
|
||||
*/
|
||||
boolean hasBids();
|
||||
|
||||
/**
|
||||
* Get the total number of bids placed.
|
||||
*/
|
||||
int getBidCount();
|
||||
|
||||
/**
|
||||
* Get when the listing was created (Unix timestamp in ms).
|
||||
*/
|
||||
long getCreatedTime();
|
||||
|
||||
/**
|
||||
* Get when the auction ends (Unix timestamp in ms).
|
||||
*/
|
||||
long getEndTime();
|
||||
|
||||
/**
|
||||
* Get the remaining time in milliseconds.
|
||||
*/
|
||||
long getRemainingTime();
|
||||
|
||||
/**
|
||||
* Check if the auction has expired.
|
||||
*/
|
||||
boolean isExpired();
|
||||
|
||||
/**
|
||||
* Check if the auction is still active (can be bid on).
|
||||
*/
|
||||
boolean isActive();
|
||||
|
||||
/**
|
||||
* Get the auction status.
|
||||
* @return 0 = Active, 1 = Ended, 2 = Cancelled, 3 = Claimed
|
||||
*/
|
||||
int getStatus();
|
||||
|
||||
/**
|
||||
* Get the minimum bid amount (current bid + increment).
|
||||
*/
|
||||
long getMinimumBid();
|
||||
|
||||
/**
|
||||
* Check if a player UUID is the seller.
|
||||
*/
|
||||
boolean isSeller(String playerUUID);
|
||||
|
||||
/**
|
||||
* Check if a player UUID is the current high bidder.
|
||||
*/
|
||||
boolean isHighBidder(String playerUUID);
|
||||
|
||||
/**
|
||||
* Get the remaining time formatted as a string (e.g., "2h 30m").
|
||||
*/
|
||||
String getRemainingTimeFormatted();
|
||||
}
|
||||
Reference in new issue
Block a user