aboutsummaryrefslogtreecommitdiff
path: root/mod
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2025-01-16 20:46:41 +0100
committerLinnea Gräf <nea@nea.moe>2025-01-16 20:46:41 +0100
commit2cc7d668eacba1919208ba6b131b01fe10bbf0ed (patch)
tree8490092dbffcc729acc4a3679028ba633e395fae /mod
parent0cb08682bc6b759a054066e145cb0332a40f42a7 (diff)
downloadLocalTransactionLedger-2cc7d668eacba1919208ba6b131b01fe10bbf0ed.tar.gz
LocalTransactionLedger-2cc7d668eacba1919208ba6b131b01fe10bbf0ed.tar.bz2
LocalTransactionLedger-2cc7d668eacba1919208ba6b131b01fe10bbf0ed.zip
refactor: Move some basetypes and fix: Kuudra chest and dungeon chest detection mixing
Diffstat (limited to 'mod')
-rw-r--r--mod/ledger-rules.pro2
-rw-r--r--mod/src/main/kotlin/moe/nea/ledger/ItemId.kt35
-rw-r--r--mod/src/main/kotlin/moe/nea/ledger/modules/BitsDetection.kt1
-rw-r--r--mod/src/main/kotlin/moe/nea/ledger/modules/BitsShopDetection.kt8
-rw-r--r--mod/src/main/kotlin/moe/nea/ledger/modules/DragonEyePlacementDetection.kt1
-rw-r--r--mod/src/main/kotlin/moe/nea/ledger/modules/DragonSacrificeDetection.kt1
-rw-r--r--mod/src/main/kotlin/moe/nea/ledger/modules/DungeonChestDetection.kt2
-rw-r--r--mod/src/main/kotlin/moe/nea/ledger/modules/EyedropsDetection.kt1
-rw-r--r--mod/src/main/kotlin/moe/nea/ledger/modules/GambleDetection.kt1
-rw-r--r--mod/src/main/kotlin/moe/nea/ledger/modules/GodPotionDetection.kt1
-rw-r--r--mod/src/main/kotlin/moe/nea/ledger/modules/KuudraChestDetection.kt3
-rw-r--r--mod/src/main/kotlin/moe/nea/ledger/modules/VisitorDetection.kt3
-rw-r--r--mod/src/main/kotlin/moe/nea/ledger/utils/NoSideEffects.kt4
13 files changed, 9 insertions, 54 deletions
diff --git a/mod/ledger-rules.pro b/mod/ledger-rules.pro
index 32cd337..faa10c2 100644
--- a/mod/ledger-rules.pro
+++ b/mod/ledger-rules.pro
@@ -1,4 +1,4 @@
-keep class !moe.nea.ledger.gen.** {*;}
-dontobfuscate
--assumenosideeffects class ** { @moe.nea.ledger.utils.NoSideEffects <methods>; }
+-assumenosideeffects class ** { @moe.nea.ledger.utils.RemoveInRelease <methods>; }
#-dontoptimize
diff --git a/mod/src/main/kotlin/moe/nea/ledger/ItemId.kt b/mod/src/main/kotlin/moe/nea/ledger/ItemId.kt
deleted file mode 100644
index 8211cd3..0000000
--- a/mod/src/main/kotlin/moe/nea/ledger/ItemId.kt
+++ /dev/null
@@ -1,35 +0,0 @@
-package moe.nea.ledger
-
-import moe.nea.ledger.utils.NoSideEffects
-
-data class ItemId(
- val string: String
-) {
- @NoSideEffects
- fun singleItem(): Pair<ItemId, Double> {
- return withStackSize(1)
- }
-
- @NoSideEffects
- fun withStackSize(size: Number): Pair<ItemId, Double> {
- return Pair(this, size.toDouble())
- }
-
-
- companion object {
-
- @JvmStatic
- @NoSideEffects
- fun forName(string: String) = ItemId(string)
- fun skill(skill: String) = ItemId("SKYBLOCK_SKILL_$skill")
-
- val GARDEN = skill("GARDEN")
- val FARMING = skill("FARMING")
-
-
- val COINS = ItemId("SKYBLOCK_COIN")
- val GEMSTONE_POWDER = ItemId("SKYBLOCK_POWDER_GEMSTONE")
- val MITHRIL_POWDER = ItemId("SKYBLOCK_POWDER_MITHRIL")
- val NIL = ItemId("SKYBLOCK_NIL")
- }
-} \ No newline at end of file
diff --git a/mod/src/main/kotlin/moe/nea/ledger/modules/BitsDetection.kt b/mod/src/main/kotlin/moe/nea/ledger/modules/BitsDetection.kt
index 44a0050..f0f5369 100644
--- a/mod/src/main/kotlin/moe/nea/ledger/modules/BitsDetection.kt
+++ b/mod/src/main/kotlin/moe/nea/ledger/modules/BitsDetection.kt
@@ -1,7 +1,6 @@
package moe.nea.ledger.modules
import moe.nea.ledger.ItemChange
-import moe.nea.ledger.ItemId
import moe.nea.ledger.events.ChatReceived
import moe.nea.ledger.events.LateWorldLoadEvent
import moe.nea.ledger.LedgerEntry
diff --git a/mod/src/main/kotlin/moe/nea/ledger/modules/BitsShopDetection.kt b/mod/src/main/kotlin/moe/nea/ledger/modules/BitsShopDetection.kt
index 553bebf..84185bf 100644
--- a/mod/src/main/kotlin/moe/nea/ledger/modules/BitsShopDetection.kt
+++ b/mod/src/main/kotlin/moe/nea/ledger/modules/BitsShopDetection.kt
@@ -22,10 +22,10 @@ class BitsShopDetection @Inject constructor(val ledger: LedgerLogger) {
data class BitShopEntry(
- val id: ItemId,
- val stackSize: Int,
- val bitPrice: Int,
- val timestamp: Long = System.currentTimeMillis()
+ val id: ItemId,
+ val stackSize: Int,
+ val bitPrice: Int,
+ val timestamp: Long = System.currentTimeMillis()
)
var lastClickedBitShopItem: BitShopEntry? = null
diff --git a/mod/src/main/kotlin/moe/nea/ledger/modules/DragonEyePlacementDetection.kt b/mod/src/main/kotlin/moe/nea/ledger/modules/DragonEyePlacementDetection.kt
index e389ffb..b7b9de1 100644
--- a/mod/src/main/kotlin/moe/nea/ledger/modules/DragonEyePlacementDetection.kt
+++ b/mod/src/main/kotlin/moe/nea/ledger/modules/DragonEyePlacementDetection.kt
@@ -1,7 +1,6 @@
package moe.nea.ledger.modules
import moe.nea.ledger.ItemChange
-import moe.nea.ledger.ItemId
import moe.nea.ledger.LedgerEntry
import moe.nea.ledger.LedgerLogger
import moe.nea.ledger.TransactionType
diff --git a/mod/src/main/kotlin/moe/nea/ledger/modules/DragonSacrificeDetection.kt b/mod/src/main/kotlin/moe/nea/ledger/modules/DragonSacrificeDetection.kt
index 574cfcf..3bf36f9 100644
--- a/mod/src/main/kotlin/moe/nea/ledger/modules/DragonSacrificeDetection.kt
+++ b/mod/src/main/kotlin/moe/nea/ledger/modules/DragonSacrificeDetection.kt
@@ -2,7 +2,6 @@ package moe.nea.ledger.modules
import moe.nea.ledger.DebouncedValue
import moe.nea.ledger.ItemChange
-import moe.nea.ledger.ItemId
import moe.nea.ledger.ItemIdProvider
import moe.nea.ledger.LedgerEntry
import moe.nea.ledger.LedgerLogger
diff --git a/mod/src/main/kotlin/moe/nea/ledger/modules/DungeonChestDetection.kt b/mod/src/main/kotlin/moe/nea/ledger/modules/DungeonChestDetection.kt
index e747be9..37d0e9c 100644
--- a/mod/src/main/kotlin/moe/nea/ledger/modules/DungeonChestDetection.kt
+++ b/mod/src/main/kotlin/moe/nea/ledger/modules/DungeonChestDetection.kt
@@ -76,7 +76,7 @@ class DungeonChestDetection @Inject constructor(val logger: LedgerLogger) : Ches
}
}
- val rewardMessage = " (WOOD|GOLD|DIAMOND|EMERALD|OBSIDIAN|BEDROCK) CHEST REWARDS".toPattern()
+ val rewardMessage = " *(WOOD|GOLD|DIAMOND|EMERALD|OBSIDIAN|BEDROCK) CHEST REWARDS".toPattern()
@SubscribeEvent
fun onChatMessage(event: ChatReceived) {
diff --git a/mod/src/main/kotlin/moe/nea/ledger/modules/EyedropsDetection.kt b/mod/src/main/kotlin/moe/nea/ledger/modules/EyedropsDetection.kt
index 04dbe80..1c36ae4 100644
--- a/mod/src/main/kotlin/moe/nea/ledger/modules/EyedropsDetection.kt
+++ b/mod/src/main/kotlin/moe/nea/ledger/modules/EyedropsDetection.kt
@@ -1,7 +1,6 @@
package moe.nea.ledger.modules
import moe.nea.ledger.ItemChange
-import moe.nea.ledger.ItemId
import moe.nea.ledger.LedgerEntry
import moe.nea.ledger.LedgerLogger
import moe.nea.ledger.TransactionType
diff --git a/mod/src/main/kotlin/moe/nea/ledger/modules/GambleDetection.kt b/mod/src/main/kotlin/moe/nea/ledger/modules/GambleDetection.kt
index a8f79c1..9149e14 100644
--- a/mod/src/main/kotlin/moe/nea/ledger/modules/GambleDetection.kt
+++ b/mod/src/main/kotlin/moe/nea/ledger/modules/GambleDetection.kt
@@ -1,7 +1,6 @@
package moe.nea.ledger.modules
import moe.nea.ledger.ItemChange
-import moe.nea.ledger.ItemId
import moe.nea.ledger.LedgerEntry
import moe.nea.ledger.LedgerLogger
import moe.nea.ledger.TransactionType
diff --git a/mod/src/main/kotlin/moe/nea/ledger/modules/GodPotionDetection.kt b/mod/src/main/kotlin/moe/nea/ledger/modules/GodPotionDetection.kt
index ae86519..e858a6b 100644
--- a/mod/src/main/kotlin/moe/nea/ledger/modules/GodPotionDetection.kt
+++ b/mod/src/main/kotlin/moe/nea/ledger/modules/GodPotionDetection.kt
@@ -1,7 +1,6 @@
package moe.nea.ledger.modules
import moe.nea.ledger.ItemChange
-import moe.nea.ledger.ItemId
import moe.nea.ledger.LedgerEntry
import moe.nea.ledger.LedgerLogger
import moe.nea.ledger.TransactionType
diff --git a/mod/src/main/kotlin/moe/nea/ledger/modules/KuudraChestDetection.kt b/mod/src/main/kotlin/moe/nea/ledger/modules/KuudraChestDetection.kt
index e0e9322..88c45d2 100644
--- a/mod/src/main/kotlin/moe/nea/ledger/modules/KuudraChestDetection.kt
+++ b/mod/src/main/kotlin/moe/nea/ledger/modules/KuudraChestDetection.kt
@@ -36,6 +36,9 @@ class KuudraChestDetection : ChestDetection() {
if (requiredKey != null && !hasKey(requiredKey)) {
return
}
+ if (requiredKey == null && event.slotIn.inventory.name != "Free Chest") {
+ return
+ }
log.logEntry(LedgerEntry(
TransactionType.KUUDRA_CHEST_OPEN,
diffs.timestamp,
diff --git a/mod/src/main/kotlin/moe/nea/ledger/modules/VisitorDetection.kt b/mod/src/main/kotlin/moe/nea/ledger/modules/VisitorDetection.kt
index f457ae4..5178e9f 100644
--- a/mod/src/main/kotlin/moe/nea/ledger/modules/VisitorDetection.kt
+++ b/mod/src/main/kotlin/moe/nea/ledger/modules/VisitorDetection.kt
@@ -5,15 +5,12 @@ import moe.nea.ledger.ItemId
import moe.nea.ledger.ItemIdProvider
import moe.nea.ledger.LedgerEntry
import moe.nea.ledger.LedgerLogger
-import moe.nea.ledger.SHORT_NUMBER_PATTERN
import moe.nea.ledger.TransactionType
import moe.nea.ledger.events.ExtraSupplyIdEvent
import moe.nea.ledger.events.GuiClickEvent
import moe.nea.ledger.getDisplayNameU
import moe.nea.ledger.getLore
-import moe.nea.ledger.parseShortNumber
import moe.nea.ledger.unformattedString
-import moe.nea.ledger.useMatcher
import moe.nea.ledger.utils.di.Inject
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import java.time.Instant
diff --git a/mod/src/main/kotlin/moe/nea/ledger/utils/NoSideEffects.kt b/mod/src/main/kotlin/moe/nea/ledger/utils/NoSideEffects.kt
deleted file mode 100644
index 9b0e7a3..0000000
--- a/mod/src/main/kotlin/moe/nea/ledger/utils/NoSideEffects.kt
+++ /dev/null
@@ -1,4 +0,0 @@
-package moe.nea.ledger.utils
-
-@Retention(AnnotationRetention.BINARY)
-annotation class NoSideEffects