aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt
index 492da55c7..b56661cd0 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt
@@ -293,9 +293,9 @@ class ItemAbilityCooldown {
val stack = event.stack
val guiOpen = Minecraft.getMinecraft().currentScreen != null
- val uuid = stack.getItemUuid() ?: stack.getItemId() ?: return
- val list = items.filter { (it.key.getItemUuid() ?: it.key.getItemId()) == uuid }
- .firstNotNullOfOrNull { it.value } ?: return
+ val uuid = stack.getIdentifier() ?: return
+ val list = items.filter { (it.key.getIdentifier()) == uuid }
+ .firstNotNullOfOrNull { it.value } ?: return
for (itemText in list) {
if (guiOpen && !itemText.onCooldown) continue
@@ -318,6 +318,8 @@ class ItemAbilityCooldown {
}
}
+ private fun ItemStack.getIdentifier() = getItemUuid() ?: getItemId()
+
@SubscribeEvent
fun onChatMessage(event: LorenzChatEvent) {
if (!isEnabled()) return