aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/util/skyblock/Rarity.kt
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-12-25 16:15:20 +0100
committerLinnea Gräf <nea@nea.moe>2024-12-25 16:15:20 +0100
commitddebaf47900dfab41590c97c202984142ae5b9f6 (patch)
tree498859e320b19d3bc7559f5585174afb78e132b4 /src/main/kotlin/util/skyblock/Rarity.kt
parente16c60169bf192b79991176b5f9cee66b5b16e7d (diff)
downloadFirmament-ddebaf47900dfab41590c97c202984142ae5b9f6.tar.gz
Firmament-ddebaf47900dfab41590c97c202984142ae5b9f6.tar.bz2
Firmament-ddebaf47900dfab41590c97c202984142ae5b9f6.zip
WIP: Reforge Recipes
Diffstat (limited to 'src/main/kotlin/util/skyblock/Rarity.kt')
-rw-r--r--src/main/kotlin/util/skyblock/Rarity.kt17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/main/kotlin/util/skyblock/Rarity.kt b/src/main/kotlin/util/skyblock/Rarity.kt
index 0244630..b19f371 100644
--- a/src/main/kotlin/util/skyblock/Rarity.kt
+++ b/src/main/kotlin/util/skyblock/Rarity.kt
@@ -8,7 +8,9 @@ import kotlinx.serialization.descriptors.SerialDescriptor
import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder
import net.minecraft.item.ItemStack
+import net.minecraft.text.Style
import net.minecraft.text.Text
+import net.minecraft.util.Formatting
import moe.nea.firmament.util.StringUtil.words
import moe.nea.firmament.util.collections.lastNotNullOfOrNull
import moe.nea.firmament.util.mc.loreAccordingToNbt
@@ -46,10 +48,23 @@ enum class Rarity(vararg altNames: String) {
}
val names = setOf(name) + altNames
-
+ val text: Text get() = Text.literal(name).setStyle(Style.EMPTY.withColor(colourMap[this]))
val neuRepoRarity: RepoRarity? = RepoRarity.entries.find { it.name == name }
companion object {
+ // TODO: inline those formattings as fields
+ val colourMap = mapOf(
+ Rarity.COMMON to Formatting.WHITE,
+ Rarity.UNCOMMON to Formatting.GREEN,
+ Rarity.RARE to Formatting.BLUE,
+ Rarity.EPIC to Formatting.DARK_PURPLE,
+ Rarity.LEGENDARY to Formatting.GOLD,
+ Rarity.MYTHIC to Formatting.LIGHT_PURPLE,
+ Rarity.DIVINE to Formatting.AQUA,
+ Rarity.SPECIAL to Formatting.RED,
+ Rarity.VERY_SPECIAL to Formatting.RED,
+ Rarity.SUPREME to Formatting.DARK_RED,
+ )
val byName = entries.flatMap { en -> en.names.map { it to en } }.toMap()
val fromNeuRepo = entries.associateBy { it.neuRepoRarity }