aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/repo/item/SBRarity.kt
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2025-03-11 12:44:59 +0100
committerLinnea Gräf <nea@nea.moe>2025-03-11 12:44:59 +0100
commit17a855a4bdfcca00b29f85981d8fb86968d9038c (patch)
tree4ecde192607e1b6fea54fc264a6b79a197ae8619 /src/main/kotlin/repo/item/SBRarity.kt
parent0765c8aee181dda89b08f89c4a7deb301f00f656 (diff)
downloadFirmament-17a855a4bdfcca00b29f85981d8fb86968d9038c.tar.gz
Firmament-17a855a4bdfcca00b29f85981d8fb86968d9038c.tar.bz2
Firmament-17a855a4bdfcca00b29f85981d8fb86968d9038c.zip
feat: add SBItemData implementation
Diffstat (limited to 'src/main/kotlin/repo/item/SBRarity.kt')
-rw-r--r--src/main/kotlin/repo/item/SBRarity.kt20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/main/kotlin/repo/item/SBRarity.kt b/src/main/kotlin/repo/item/SBRarity.kt
new file mode 100644
index 0000000..d2ddd0b
--- /dev/null
+++ b/src/main/kotlin/repo/item/SBRarity.kt
@@ -0,0 +1,20 @@
+package moe.nea.firmament.repo.item
+
+import com.google.auto.service.AutoService
+import io.github.moulberry.repo.data.NEUItem
+import net.minecraft.item.ItemStack
+import moe.nea.firmament.util.skyblock.Rarity
+
+@AutoService(SBItemProperty::class)
+object SBRarity : SBItemProperty<Rarity>() {
+ override fun fromStack(
+ stack: ItemStack,
+ store: SBItemData
+ ): Rarity? {
+ return Rarity.fromItem(stack)
+ }
+
+ override fun fromNeuItem(neuItem: NEUItem, store: SBItemData): Rarity? {
+ return Rarity.fromStringLore(neuItem.lore)
+ }
+}