mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 07:59:08 +00:00
- Add auction enums: - EnumAuctionDuration.java - configurable auction durations (SHORT/MEDIUM/LONG/VERY_LONG) - EnumAuctionStatus.java - listing statuses (ACTIVE/SOLD/EXPIRED/CANCELLED/CLAIMED) - EnumAuctionCategory.java - auto-categorization of items for browsing - Add AuctionListing.java data class: - Complete auction listing with seller/bidder tracking - Pricing with starting price, buyout price, current bid - Timing with snipe protection (extends TO X minutes, not by) - Item validation (checks trade restrictions and blacklist) - Previous bidder tracking for refund notifications - NBT serialization for persistence - Add AuctionController.java: - Global auction house management - Create/cancel/finalize listings - Bid placement with automatic outbid refunds via claims system - Buyout support with immediate sale - Claim system for sellers (proceeds) and buyers (items) - Search and filter by category/name - Periodic expiration processing - Persistence via auctions.dat - Add RoleAuctioneer.java NPC role: - Configurable tabs (listings, my listings, my bids, claims) - Configurable permissions (create, bid, buyout) - Custom welcome/disabled messages - Opens auction GUI on interaction - Update ConfigMarket.java: - Duration-specific settings (hours and fees) - Removed deprecated AvailableDurations string - Update EnumRoleType.java - add Auctioneer - Update EnumGuiType.java - add PlayerAuction, SetupAuctioneer - Update DataAdvanced.java - handle Auctioneer role creation - Update CustomNpcs.java - initialize AuctionController
55 lines
1.5 KiB
Java
55 lines
1.5 KiB
Java
package noppes.npcs.constants;
|
|
|
|
/**
|
|
* Status of an auction listing.
|
|
*/
|
|
public enum EnumAuctionStatus {
|
|
ACTIVE, // Currently listed and accepting bids
|
|
SOLD, // Successfully sold (buyout or auction end with bids)
|
|
EXPIRED, // Ended without any bids
|
|
CANCELLED, // Cancelled by seller (only allowed before first bid)
|
|
CLAIMED; // Item/money has been claimed by respective parties
|
|
|
|
/**
|
|
* Get display name for GUI
|
|
*/
|
|
public String getDisplayName() {
|
|
switch (this) {
|
|
case ACTIVE: return "Active";
|
|
case SOLD: return "Sold";
|
|
case EXPIRED: return "Expired";
|
|
case CANCELLED: return "Cancelled";
|
|
case CLAIMED: return "Claimed";
|
|
default: return "Unknown";
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Get display color for GUI (MC color codes)
|
|
*/
|
|
public char getColorCode() {
|
|
switch (this) {
|
|
case ACTIVE: return 'a'; // Green
|
|
case SOLD: return '6'; // Gold
|
|
case EXPIRED: return '7'; // Gray
|
|
case CANCELLED: return 'c'; // Red
|
|
case CLAIMED: return '8'; // Dark gray
|
|
default: return 'f'; // White
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Check if listing can still receive bids
|
|
*/
|
|
public boolean canBid() {
|
|
return this == ACTIVE;
|
|
}
|
|
|
|
/**
|
|
* Check if listing needs claiming (item or money)
|
|
*/
|
|
public boolean needsClaiming() {
|
|
return this == SOLD || this == EXPIRED || this == CANCELLED;
|
|
}
|
|
}
|