aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-08-10 18:12:42 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-08-10 18:12:42 +0200
commit77ffcdd576b4dfdae5ad41826964bbee8db0ca1a (patch)
treec0ef39c955a671dd9cac60b5218e93efcb508cb6
parentf4f5e3713d1f084cf26aa8abf3df4d3647f7b0ef (diff)
downloadskyhanni-77ffcdd576b4dfdae5ad41826964bbee8db0ca1a.tar.gz
skyhanni-77ffcdd576b4dfdae5ad41826964bbee8db0ca1a.tar.bz2
skyhanni-77ffcdd576b4dfdae5ad41826964bbee8db0ca1a.zip
Code cleanup
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/HarpFeatures.kt9
1 files changed, 5 insertions, 4 deletions
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()