From fa0f36a463fda965fb774ec7c3930c9a12f86852 Mon Sep 17 00:00:00 2001 From: saga Date: Tue, 4 Jun 2024 12:30:23 -0300 Subject: [PATCH 1/9] stone --- .../features/inventory/InventoryConfig.java | 7 ++ .../storage/ProfileSpecificStorage.java | 3 + .../at/hannibal2/skyhanni/data/MaxwellAPI.kt | 8 ++- .../features/inventory/FavoritePowerStone.kt | 72 +++++++++++++++++++ 4 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 src/main/java/at/hannibal2/skyhanni/features/inventory/FavoritePowerStone.kt diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java index 872fb8ad6ba1..6a2861f299ca 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java @@ -212,6 +212,13 @@ public String toString() { @FeatureToggle public boolean powerStoneGuide = true; + @Expose + @ConfigOption(name = "Favorite Power Stone", desc = "Shows your favorite power stones. You can add/remove them by shift clicking a Power Stone,") + @ConfigEditorBoolean + @FeatureToggle + public boolean favoritePowerStone = false; + + @Expose @ConfigOption(name = "Shift Click Equipment", desc = "Makes normal clicks to shift clicks in equipment inventory.") @ConfigEditorBoolean diff --git a/src/main/java/at/hannibal2/skyhanni/config/storage/ProfileSpecificStorage.java b/src/main/java/at/hannibal2/skyhanni/config/storage/ProfileSpecificStorage.java index d88ccb315313..42859146ed59 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/storage/ProfileSpecificStorage.java +++ b/src/main/java/at/hannibal2/skyhanni/config/storage/ProfileSpecificStorage.java @@ -151,6 +151,9 @@ public static class MaxwellPowerStorage { @Expose public List tunings = new ArrayList<>(); + + @Expose + public List favoritePowers = new ArrayList<>(); } @Expose diff --git a/src/main/java/at/hannibal2/skyhanni/data/MaxwellAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/MaxwellAPI.kt index cc9a6aa43931..060181815a14 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/MaxwellAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/MaxwellAPI.kt @@ -49,6 +49,12 @@ object MaxwellAPI { storage?.maxwell?.tunings = value ?: return } + var favoritePowers: List + get() = storage?.maxwell?.favoritePowers ?: listOf() + set(value) { + storage?.maxwell?.favoritePowers = value + } + private var powers = mutableListOf() private val patternGroup = RepoPattern.group("data.maxwell") @@ -282,7 +288,7 @@ object MaxwellAPI { if (!foundMagicalPower) magicalPower = 0 } - private fun getPowerByNameOrNull(name: String) = powers.find { it == name } + fun getPowerByNameOrNull(name: String) = powers.find { it == name } private fun isEnabled() = LorenzUtils.inSkyBlock && storage != null diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/FavoritePowerStone.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/FavoritePowerStone.kt new file mode 100644 index 000000000000..5111fa19de5a --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/FavoritePowerStone.kt @@ -0,0 +1,72 @@ +package at.hannibal2.skyhanni.features.inventory + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.data.MaxwellAPI +import at.hannibal2.skyhanni.data.MaxwellAPI.favoritePowers +import at.hannibal2.skyhanni.data.MaxwellAPI.isThaumaturgyInventory +import at.hannibal2.skyhanni.data.ProfileStorageData +import at.hannibal2.skyhanni.events.GuiContainerEvent +import at.hannibal2.skyhanni.events.InventoryCloseEvent +import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent +import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule +import at.hannibal2.skyhanni.utils.InventoryUtils +import at.hannibal2.skyhanni.utils.ItemUtils.name +import at.hannibal2.skyhanni.utils.KeyboardManager +import at.hannibal2.skyhanni.utils.LorenzColor +import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.RenderUtils.highlight +import at.hannibal2.skyhanni.utils.StringUtils.removeColor +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +@SkyHanniModule +object FavoritePowerStone { + + private val config get() = SkyHanniMod.feature.inventory + private val storage get() = ProfileStorageData.profileSpecific + private var highlightedSlots = mutableSetOf() + + @SubscribeEvent + fun onBackgroundDrawn(event: GuiContainerEvent.BackgroundDrawnEvent) { + if (!isEnabled()) return + if (!isThaumaturgyInventory(InventoryUtils.openInventoryName())) return + + highlightedSlots.forEach { event.gui.inventorySlots.inventorySlots[it] highlight LorenzColor.AQUA } + } + + @SubscribeEvent + fun onSlotClick(event: GuiContainerEvent.SlotClickEvent) { + if (!isEnabled() || !KeyboardManager.isShiftKeyDown()) return + if (!isThaumaturgyInventory(InventoryUtils.openInventoryName())) return + + val displayName = event.item?.name?.removeColor()?.trim() ?: return + val power = MaxwellAPI.getPowerByNameOrNull(displayName) ?: return + + if (power in favoritePowers) { + favoritePowers -= power + highlightedSlots -= event.slotId + } else { + favoritePowers += power + highlightedSlots += event.slotId + } + + event.cancel() + } + + @SubscribeEvent + fun onInventoryOpen(event: InventoryFullyOpenedEvent) { + if (!isEnabled()) return + if (!isThaumaturgyInventory(event.inventoryName)) return + + event.inventoryItems.forEach { (slot, item) -> + if (item.displayName in favoritePowers) highlightedSlots += slot + } + } + + @SubscribeEvent + fun onInventoryClose(event: InventoryCloseEvent) { + highlightedSlots = mutableSetOf() + } + + private fun isEnabled() = + LorenzUtils.inSkyBlock && storage != null && config.favoritePowerStone +} From 1de6f84e82abf01f50772b188d41c04b56b32070 Mon Sep 17 00:00:00 2001 From: saga Date: Tue, 4 Jun 2024 14:04:47 -0300 Subject: [PATCH 2/9] o-o --- .../skyhanni/features/inventory/FavoritePowerStone.kt | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/FavoritePowerStone.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/FavoritePowerStone.kt index 5111fa19de5a..c859bffeb188 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/FavoritePowerStone.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/FavoritePowerStone.kt @@ -6,8 +6,7 @@ import at.hannibal2.skyhanni.data.MaxwellAPI.favoritePowers import at.hannibal2.skyhanni.data.MaxwellAPI.isThaumaturgyInventory import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.events.GuiContainerEvent -import at.hannibal2.skyhanni.events.InventoryCloseEvent -import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent +import at.hannibal2.skyhanni.events.InventoryUpdatedEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.ItemUtils.name @@ -23,6 +22,7 @@ object FavoritePowerStone { private val config get() = SkyHanniMod.feature.inventory private val storage get() = ProfileStorageData.profileSpecific + private var highlightedSlots = mutableSetOf() @SubscribeEvent @@ -53,7 +53,7 @@ object FavoritePowerStone { } @SubscribeEvent - fun onInventoryOpen(event: InventoryFullyOpenedEvent) { + fun onInventoryUpdated(event: InventoryUpdatedEvent) { if (!isEnabled()) return if (!isThaumaturgyInventory(event.inventoryName)) return @@ -62,11 +62,6 @@ object FavoritePowerStone { } } - @SubscribeEvent - fun onInventoryClose(event: InventoryCloseEvent) { - highlightedSlots = mutableSetOf() - } - private fun isEnabled() = LorenzUtils.inSkyBlock && storage != null && config.favoritePowerStone } From 640bcfd789645c05ade8580a581967f3217fb1e5 Mon Sep 17 00:00:00 2001 From: saga <45262877+saga-00@users.noreply.github.com> Date: Tue, 4 Jun 2024 23:00:46 -0300 Subject: [PATCH 3/9] Update src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java Co-authored-by: CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> --- .../skyhanni/config/features/inventory/InventoryConfig.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java index 6a2861f299ca..05f70105900c 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java @@ -213,12 +213,11 @@ public String toString() { public boolean powerStoneGuide = true; @Expose - @ConfigOption(name = "Favorite Power Stone", desc = "Shows your favorite power stones. You can add/remove them by shift clicking a Power Stone,") + @ConfigOption(name = "Favorite Power Stone", desc = "Shows your favorite power stones. You can add/remove them by shift clicking a Power Stone.") @ConfigEditorBoolean @FeatureToggle public boolean favoritePowerStone = false; - @Expose @ConfigOption(name = "Shift Click Equipment", desc = "Makes normal clicks to shift clicks in equipment inventory.") @ConfigEditorBoolean From a090c63d3850f38545d9e9fc1aee34d334cb419b Mon Sep 17 00:00:00 2001 From: saga <45262877+saga-00@users.noreply.github.com> Date: Tue, 4 Jun 2024 23:03:33 -0300 Subject: [PATCH 4/9] Update FavoritePowerStone.kt --- .../features/inventory/FavoritePowerStone.kt | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/FavoritePowerStone.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/FavoritePowerStone.kt index c859bffeb188..cb2dd2b89a16 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/FavoritePowerStone.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/FavoritePowerStone.kt @@ -2,8 +2,6 @@ package at.hannibal2.skyhanni.features.inventory import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.data.MaxwellAPI -import at.hannibal2.skyhanni.data.MaxwellAPI.favoritePowers -import at.hannibal2.skyhanni.data.MaxwellAPI.isThaumaturgyInventory import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.InventoryUpdatedEvent @@ -28,7 +26,7 @@ object FavoritePowerStone { @SubscribeEvent fun onBackgroundDrawn(event: GuiContainerEvent.BackgroundDrawnEvent) { if (!isEnabled()) return - if (!isThaumaturgyInventory(InventoryUtils.openInventoryName())) return + if (!MaxwellAPI.isThaumaturgyInventory(InventoryUtils.openInventoryName())) return highlightedSlots.forEach { event.gui.inventorySlots.inventorySlots[it] highlight LorenzColor.AQUA } } @@ -36,16 +34,16 @@ object FavoritePowerStone { @SubscribeEvent fun onSlotClick(event: GuiContainerEvent.SlotClickEvent) { if (!isEnabled() || !KeyboardManager.isShiftKeyDown()) return - if (!isThaumaturgyInventory(InventoryUtils.openInventoryName())) return + if (!MaxwellAPI.isThaumaturgyInventory(InventoryUtils.openInventoryName())) return val displayName = event.item?.name?.removeColor()?.trim() ?: return val power = MaxwellAPI.getPowerByNameOrNull(displayName) ?: return if (power in favoritePowers) { - favoritePowers -= power + MaxwellAPI.favoritePowers -= power highlightedSlots -= event.slotId } else { - favoritePowers += power + MaxwellAPI.favoritePowers += power highlightedSlots += event.slotId } @@ -55,10 +53,10 @@ object FavoritePowerStone { @SubscribeEvent fun onInventoryUpdated(event: InventoryUpdatedEvent) { if (!isEnabled()) return - if (!isThaumaturgyInventory(event.inventoryName)) return + if (!MaxwellAPI.isThaumaturgyInventory(event.inventoryName)) return event.inventoryItems.forEach { (slot, item) -> - if (item.displayName in favoritePowers) highlightedSlots += slot + if (item.displayName in MaxwellAPI.favoritePowers) highlightedSlots += slot } } From 91c607826c8b35b033209a48a7ccc7b5078a5ca3 Mon Sep 17 00:00:00 2001 From: saga <45262877+saga-00@users.noreply.github.com> Date: Tue, 4 Jun 2024 23:04:46 -0300 Subject: [PATCH 5/9] Update FavoritePowerStone.kt --- .../hannibal2/skyhanni/features/inventory/FavoritePowerStone.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/FavoritePowerStone.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/FavoritePowerStone.kt index cb2dd2b89a16..b3246cd3cf3f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/FavoritePowerStone.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/FavoritePowerStone.kt @@ -39,7 +39,7 @@ object FavoritePowerStone { val displayName = event.item?.name?.removeColor()?.trim() ?: return val power = MaxwellAPI.getPowerByNameOrNull(displayName) ?: return - if (power in favoritePowers) { + if (power in MaxwellAPI.favoritePowers) { MaxwellAPI.favoritePowers -= power highlightedSlots -= event.slotId } else { From 417d9d9989a8f6be00af8dc1eb0bb4cbcdb2d0e7 Mon Sep 17 00:00:00 2001 From: Cal Date: Wed, 5 Jun 2024 17:40:28 +1000 Subject: [PATCH 6/9] a bit of code cleanup --- .../skyhanni/features/inventory/FavoritePowerStone.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/FavoritePowerStone.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/FavoritePowerStone.kt index b3246cd3cf3f..ffb81a2e11cd 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/FavoritePowerStone.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/FavoritePowerStone.kt @@ -60,6 +60,5 @@ object FavoritePowerStone { } } - private fun isEnabled() = - LorenzUtils.inSkyBlock && storage != null && config.favoritePowerStone + private fun isEnabled() = LorenzUtils.inSkyBlock && storage != null && config.favoritePowerStone } From 7a907ac6c21eeb936a3cbf192eaeb9d60d8d7989 Mon Sep 17 00:00:00 2001 From: saga Date: Wed, 5 Jun 2024 10:58:01 -0300 Subject: [PATCH 7/9] fixes --- .../features/inventory/FavoritePowerStone.kt | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/FavoritePowerStone.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/FavoritePowerStone.kt index c859bffeb188..815556e094bd 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/FavoritePowerStone.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/FavoritePowerStone.kt @@ -6,9 +6,9 @@ import at.hannibal2.skyhanni.data.MaxwellAPI.favoritePowers import at.hannibal2.skyhanni.data.MaxwellAPI.isThaumaturgyInventory import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.events.GuiContainerEvent -import at.hannibal2.skyhanni.events.InventoryUpdatedEvent +import at.hannibal2.skyhanni.events.InventoryCloseEvent +import at.hannibal2.skyhanni.events.InventoryOpenEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule -import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.KeyboardManager import at.hannibal2.skyhanni.utils.LorenzColor @@ -23,20 +23,19 @@ object FavoritePowerStone { private val config get() = SkyHanniMod.feature.inventory private val storage get() = ProfileStorageData.profileSpecific - private var highlightedSlots = mutableSetOf() + private var highlightedSlots = setOf() + private var inInventory = false @SubscribeEvent fun onBackgroundDrawn(event: GuiContainerEvent.BackgroundDrawnEvent) { - if (!isEnabled()) return - if (!isThaumaturgyInventory(InventoryUtils.openInventoryName())) return + if (!isEnabled() || !inInventory) return highlightedSlots.forEach { event.gui.inventorySlots.inventorySlots[it] highlight LorenzColor.AQUA } } @SubscribeEvent fun onSlotClick(event: GuiContainerEvent.SlotClickEvent) { - if (!isEnabled() || !KeyboardManager.isShiftKeyDown()) return - if (!isThaumaturgyInventory(InventoryUtils.openInventoryName())) return + if (!isEnabled() || !KeyboardManager.isShiftKeyDown() || !inInventory) return val displayName = event.item?.name?.removeColor()?.trim() ?: return val power = MaxwellAPI.getPowerByNameOrNull(displayName) ?: return @@ -53,15 +52,22 @@ object FavoritePowerStone { } @SubscribeEvent - fun onInventoryUpdated(event: InventoryUpdatedEvent) { + fun onInventoryOpen(event: InventoryOpenEvent) { if (!isEnabled()) return if (!isThaumaturgyInventory(event.inventoryName)) return + inInventory = true + highlightedSlots = setOf() event.inventoryItems.forEach { (slot, item) -> if (item.displayName in favoritePowers) highlightedSlots += slot } } + @SubscribeEvent + fun onInventoryClose(event: InventoryCloseEvent) { + inInventory = false + } + private fun isEnabled() = LorenzUtils.inSkyBlock && storage != null && config.favoritePowerStone } From b6b05df7667860b6674504a9bf77a4239bdce90d Mon Sep 17 00:00:00 2001 From: saga Date: Wed, 5 Jun 2024 11:10:44 -0300 Subject: [PATCH 8/9] fixes2 --- .../features/inventory/FavoritePowerStone.kt | 28 +++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/FavoritePowerStone.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/FavoritePowerStone.kt index ffb81a2e11cd..f5756ef18e77 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/FavoritePowerStone.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/FavoritePowerStone.kt @@ -4,9 +4,10 @@ import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.data.MaxwellAPI import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.events.GuiContainerEvent +import at.hannibal2.skyhanni.events.InventoryCloseEvent +import at.hannibal2.skyhanni.events.InventoryOpenEvent import at.hannibal2.skyhanni.events.InventoryUpdatedEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule -import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.KeyboardManager import at.hannibal2.skyhanni.utils.LorenzColor @@ -21,20 +22,19 @@ object FavoritePowerStone { private val config get() = SkyHanniMod.feature.inventory private val storage get() = ProfileStorageData.profileSpecific - private var highlightedSlots = mutableSetOf() + private var highlightedSlots = setOf() + private var inInventory = false @SubscribeEvent fun onBackgroundDrawn(event: GuiContainerEvent.BackgroundDrawnEvent) { - if (!isEnabled()) return - if (!MaxwellAPI.isThaumaturgyInventory(InventoryUtils.openInventoryName())) return + if (!isEnabled() || !inInventory) return highlightedSlots.forEach { event.gui.inventorySlots.inventorySlots[it] highlight LorenzColor.AQUA } } @SubscribeEvent fun onSlotClick(event: GuiContainerEvent.SlotClickEvent) { - if (!isEnabled() || !KeyboardManager.isShiftKeyDown()) return - if (!MaxwellAPI.isThaumaturgyInventory(InventoryUtils.openInventoryName())) return + if (!isEnabled() || !KeyboardManager.isShiftKeyDown() || !inInventory) return val displayName = event.item?.name?.removeColor()?.trim() ?: return val power = MaxwellAPI.getPowerByNameOrNull(displayName) ?: return @@ -50,15 +50,27 @@ object FavoritePowerStone { event.cancel() } + @SubscribeEvent + fun onInventoryOpen(event: InventoryOpenEvent) { + if (!isEnabled() || !MaxwellAPI.isThaumaturgyInventory(event.inventoryName)) return + + inInventory = true + } + @SubscribeEvent fun onInventoryUpdated(event: InventoryUpdatedEvent) { - if (!isEnabled()) return - if (!MaxwellAPI.isThaumaturgyInventory(event.inventoryName)) return + if (!isEnabled() || !inInventory) return + highlightedSlots = setOf() event.inventoryItems.forEach { (slot, item) -> if (item.displayName in MaxwellAPI.favoritePowers) highlightedSlots += slot } } + @SubscribeEvent + fun onInventoryClose(event: InventoryCloseEvent) { + inInventory = false + } + private fun isEnabled() = LorenzUtils.inSkyBlock && storage != null && config.favoritePowerStone } From 1727a2b2e51073f9ec316c3279d14c9497e7c5bb Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Wed, 5 Jun 2024 21:02:53 +0200 Subject: [PATCH 9/9] code cleanup --- .../skyhanni/features/inventory/FavoritePowerStone.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/FavoritePowerStone.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/FavoritePowerStone.kt index f5756ef18e77..91727dc01841 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/FavoritePowerStone.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/FavoritePowerStone.kt @@ -61,10 +61,9 @@ object FavoritePowerStone { fun onInventoryUpdated(event: InventoryUpdatedEvent) { if (!isEnabled() || !inInventory) return - highlightedSlots = setOf() - event.inventoryItems.forEach { (slot, item) -> - if (item.displayName in MaxwellAPI.favoritePowers) highlightedSlots += slot - } + highlightedSlots = event.inventoryItems + .filter { (_, item) -> item.displayName.removeColor() in MaxwellAPI.favoritePowers } + .keys } @SubscribeEvent