From c7931c924cd15a754595e245484b743c31b539a6 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Fri, 24 May 2024 15:14:17 +0200 Subject: code cleanup --- .../at/hannibal2/skyhanni/features/inventory/HighlightBonzoMasks.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/main/java/at') 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)) { -- cgit