From 77ffcdd576b4dfdae5ad41826964bbee8db0ca1a Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Thu, 10 Aug 2023 18:12:42 +0200 Subject: Code cleanup --- .../java/at/hannibal2/skyhanni/features/misc/HarpFeatures.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/HarpFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/HarpFeatures.kt index 749fb8a64..3c3911f9a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/HarpFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/HarpFeatures.kt @@ -15,6 +15,7 @@ import kotlin.time.Duration.Companion.milliseconds // Delaying key presses by 300ms comes from NotEnoughUpdates class HarpFeatures { + private val config get() = SkyHanniMod.feature.misc private var lastClick = SimpleTimeMark.farPast() private val keys = listOf( @@ -32,7 +33,7 @@ class HarpFeatures { @SubscribeEvent fun onGui(event: GuiScreenEvent) { if (!LorenzUtils.inSkyBlock) return - if (!SkyHanniMod.feature.misc.harpKeybinds) return + if (!config.harpKeybinds) return if (!openInventoryName().startsWith("Harp")) return val chest = event.gui as? GuiChest ?: return @@ -56,12 +57,12 @@ class HarpFeatures { @SubscribeEvent fun onRenderItemTip(event: RenderItemTipEvent) { if (!LorenzUtils.inSkyBlock) return - if (!SkyHanniMod.feature.misc.harpNumbers) return + if (!config.harpNumbers) return if (!openInventoryName().startsWith("Harp")) return if (Item.getIdFromItem(event.stack.item) != 159) return // Stained hardened clay item id = 159 - val index = - buttonColors.indexOfFirst { it == event.stack.displayName[1] } // Example: §9| §7Click! will select the 9 + // Example: §9| §7Click! will select the 9 + val index = buttonColors.indexOfFirst { it == event.stack.displayName[1] } if (index == -1) return // this should never happen unless there's an update event.stackTip = (index + 1).toString() -- cgit