aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-12-30 21:48:56 +0100
committerLinnea Gräf <nea@nea.moe>2024-12-30 21:48:56 +0100
commit1c0090ec301b87edebc29453287e585f88de2c4f (patch)
tree588b3e3269da774f924308c7b51503bf5a8b3ff1 /src/main/kotlin/moe
parent9122f9c85e96d988eeebe760af19edc50222f909 (diff)
downloadLocalTransactionLedger-1c0090ec301b87edebc29453287e585f88de2c4f.tar.gz
LocalTransactionLedger-1c0090ec301b87edebc29453287e585f88de2c4f.tar.bz2
LocalTransactionLedger-1c0090ec301b87edebc29453287e585f88de2c4f.zip
feat: Add auto generated ItemIds class
Diffstat (limited to 'src/main/kotlin/moe')
-rw-r--r--src/main/kotlin/moe/nea/ledger/ItemId.kt7
-rw-r--r--src/main/kotlin/moe/nea/ledger/modules/GambleDetection.kt3
2 files changed, 7 insertions, 3 deletions
diff --git a/src/main/kotlin/moe/nea/ledger/ItemId.kt b/src/main/kotlin/moe/nea/ledger/ItemId.kt
index 6be23fb..f4786cd 100644
--- a/src/main/kotlin/moe/nea/ledger/ItemId.kt
+++ b/src/main/kotlin/moe/nea/ledger/ItemId.kt
@@ -1,7 +1,6 @@
package moe.nea.ledger
-@JvmInline
-value class ItemId(
+data class ItemId(
val string: String
) {
fun singleItem(): Pair<ItemId, Double> {
@@ -14,11 +13,15 @@ value class ItemId(
companion object {
+
+ @JvmStatic
+ fun forName(string: String) = ItemId(string)
fun skill(skill: String) = ItemId("SKYBLOCK_SKILL_$skill")
val GARDEN = skill("GARDEN")
val FARMING = skill("FARMING")
+
val ARCHFIEND_DYE = ItemId("DYE_ARCHFIEND")
val ARCHFIEND_HIGH_CLASS = ItemId("HIGH_CLASS_ARCHFIEND_DICE")
val ARCHFIEND_LOW_CLASS = ItemId("ARCHFIEND_DICE")
diff --git a/src/main/kotlin/moe/nea/ledger/modules/GambleDetection.kt b/src/main/kotlin/moe/nea/ledger/modules/GambleDetection.kt
index 6a339d7..0ef43a2 100644
--- a/src/main/kotlin/moe/nea/ledger/modules/GambleDetection.kt
+++ b/src/main/kotlin/moe/nea/ledger/modules/GambleDetection.kt
@@ -6,6 +6,7 @@ import moe.nea.ledger.LedgerEntry
import moe.nea.ledger.LedgerLogger
import moe.nea.ledger.TransactionType
import moe.nea.ledger.events.ChatReceived
+import moe.nea.ledger.gen.ItemIds
import moe.nea.ledger.useMatcher
import moe.nea.ledger.utils.di.Inject
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
@@ -33,7 +34,7 @@ class GambleDetection {
listOf(
ItemChange.lose(item, 1),
ItemChange.loseCoins(rollCost),
- ItemChange.gain(ItemId.ARCHFIEND_DYE, 1),
+ ItemChange.gain(ItemIds.DYE_ARCHFIEND, 1),
)
))
} else if (face == "6") {