ADMIN("dark_red"),
VERY_SPECIAL("red"),
SPECIAL("red"),
DIVINE("aqua"),
MYTHIC("light_purple"),
LEGENDARY("gold"),
EPIC("dark_purple"),
RARE("dark_blue"),
UNCOMMON("green"),
COMMON("white"),
;``` lets say i have a element from this enum EPIC how can i get the one above it and below it?
#Enums
1 messages ยท Page 1 of 1 (latest)
Detected code, here are some useful tools:
<@&987246399047479336> please have a look, thanks.
Here is an AI assisted attempt to answer your question ๐ค. Maybe it helps! In any case, a human is on the way ๐. To continue talking to the AI, you can use </chatgpt:1108714622413963314>.
```java
ADMIN("dark_red"),
VERY_SPECIAL("red"),
SPECIAL("red"),
DIVINE("aqua"),
MYTHIC("light_purple"),
LEGENDARY("gold"),
EPIC("dark_purple"),
RARE("dark_blue"),
UNCOMMON("green"),
COMMON("white"),
;``` lets say
UNCOMMON("green"),
COMMON("white");
public enum Rarity {
ADMIN("dark_red"),
VERY_SPECIAL("red"),
SPECIAL("red"),
DIVINE("aqua"),
MYTHIC("light_purple"),
LEGENDARY("gold"),
EPIC("dark_purple"),
RARE("dark_blue"),
UNCOMMON("green"),
COMMON("white");
private final String color;
Rarity(String color) {
this.color = color;
}
public String getColor() {
return color;
}
}
// Each enum constant represents a rarity level with a corresponding color
// Can be used to assign colors to different rarity levels in a game or application
- AI generated response
in what context ? You have for example epic and now f.e. your card gets a evolution and you want to turn it in Rare ?
Lets say i have EPIC and it gets upgraded i want LEGENDARY
Or i have EPIC and its get degraded i want RARE
just how to get the thing above and below it
U can implement it
Add smth like index in ur constructor
And implement methods like, getPreview, getNext
Rest is logic
hm
/**
* In case its already ADMIN it returns ADMIN
* @return Upgraded rarity
* @since 1.0.0
*/
public Rarity upgrade() {
if (this.ordinal() == Rarity.VERY_SPECIAL.ordinal()) return this;
return values()[this.ordinal() - 1];
}
/**
* In case its already COMMON it returns COMMON
* @return Degraded rarity
* @since 1.0.0
*/
public Rarity degrade() {
if (this.ordinal() == Rarity.COMMON.ordinal()) return this;
return values()[this.ordinal() + 1];
}``` i did this
Detected code, here are some useful tools:
i think that should work
So u want to check it with statements?
Then u need to define statement for every case
Evry single one case
It should be dynamic
Automatic
Idk how to name it
Ah
I see
Nevermind
My bad. I read it wrong, then it should work
@tidal tinsel what u working on anyways hmm, it it like a hypixel skyblock clone
exactlyy
it is a plugin? ๐
yes it is a Bukkit Plugin
๐คท
it was made in Minestom intially but i got bored of minestom
- bukkit is a bit easier to manage imma say
my only main task is to make it AS SCALABLE as possible
using inheritance for almost everything i can
@quartz stump what made u think its not bukkit 
i have mistaken you with the other guy who is making something with mcp because you two have similiar pfps hah
@tidal tinsel do you use paper
yes
oh cool so you havethe minimessage api
i do
this guy hah
nice
These 2 guys were talking in the same thread at some point iirc, I thought he was schizo for a sec
lkmao