mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-28 14:45:59 +00:00
Auction System Implementation
This commit is contained in:
1 parent
9cbd9fd3eb
commit
5afa1c8959
60 files changed
+6187
-589
No files matched your search
@@ -0,0 +1,47 @@
|
||||
package noppes.npcs.constants;
|
||||
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
public enum EnumAuctionStatus {
|
||||
ACTIVE("auction.status.active"),
|
||||
ENDED("auction.status.ended"),
|
||||
CANCELLED("auction.status.cancelled"),
|
||||
CLAIMED("auction.status.claimed");
|
||||
|
||||
private final String langKey;
|
||||
|
||||
EnumAuctionStatus(String langKey) {
|
||||
this.langKey = langKey;
|
||||
}
|
||||
|
||||
public String getLangKey() {
|
||||
return langKey;
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return StatCollector.translateToLocal(langKey);
|
||||
}
|
||||
|
||||
public boolean isActive() {
|
||||
return this == ACTIVE;
|
||||
}
|
||||
|
||||
public boolean isEnded() {
|
||||
return this == ENDED || this == CANCELLED || this == CLAIMED;
|
||||
}
|
||||
|
||||
public boolean canBid() {
|
||||
return this == ACTIVE;
|
||||
}
|
||||
|
||||
public boolean canCancel() {
|
||||
return this == ACTIVE;
|
||||
}
|
||||
|
||||
public static EnumAuctionStatus fromOrdinal(int ordinal) {
|
||||
if (ordinal >= 0 && ordinal < values().length) {
|
||||
return values()[ordinal];
|
||||
}
|
||||
return ACTIVE;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user