aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-05-24 15:14:17 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-05-24 15:14:17 +0200
commitc7931c924cd15a754595e245484b743c31b539a6 (patch)
tree1e4ad17abe238d52729198fd5906bf77f977d98b /src/main/java/at/hannibal2/skyhanni/features
parent37b1df827f2f13663d7011057c9b7855aa96ee2c (diff)
downloadskyhanni-c7931c924cd15a754595e245484b743c31b539a6.tar.gz
skyhanni-c7931c924cd15a754595e245484b743c31b539a6.tar.bz2
skyhanni-c7931c924cd15a754595e245484b743c31b539a6.zip
code cleanup
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/HighlightBonzoMasks.kt5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/HighlightBonzoMasks.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/HighlightBonzoMasks.kt
index 02ca00298..c154dd38b 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/inventory/HighlightBonzoMasks.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/HighlightBonzoMasks.kt
@@ -46,8 +46,8 @@ object HighlightBonzoMasks {
fun onBackgroundDrawn(event: GuiContainerEvent.BackgroundDrawnEvent) {
if (!config.depletedBonzosMasks) return
for (slot in event.gui.inventorySlots.inventorySlots) {
- val item = slot.stack ?: continue
- val maskType = MaskType.getByInternalName(item.getInternalName()) ?: continue
+ val internalName = slot.stack?.getInternalName() ?: continue
+ val maskType = MaskType.getByInternalName(internalName) ?: continue
val readyAt = maskTimers[maskType] ?: continue
if (readyAt.isInFuture()) {
@@ -60,6 +60,7 @@ object HighlightBonzoMasks {
@SubscribeEvent
fun onChat(event: LorenzChatEvent) {
val message = event.message.removeColor()
+ // TODO move pattern into enum
if (bonzoMaskPattern.matches(message)) {
maskTimers[MaskType.BONZO_MASK] = SimpleTimeMark.now() + MaskType.BONZO_MASK.cooldown
} else if (spiritMaskPattern.matches(message)) {