aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2
diff options
context:
space:
mode:
authorBrandon <brandon.wamboldt@gmail.com>2023-09-27 08:22:42 -0300
committerGitHub <noreply@github.com>2023-09-27 13:22:42 +0200
commitfe21cf0a129ed824de22d8ef426422fce9d90c12 (patch)
tree7133f898d3aa12564ac8271032a4d1d8bdf70e76 /src/main/java/at/hannibal2
parent33235af9cb859e2f52672d6b5f2ac5104a6046d5 (diff)
downloadskyhanni-fe21cf0a129ed824de22d8ef426422fce9d90c12.tar.gz
skyhanni-fe21cf0a129ed824de22d8ef426422fce9d90c12.tar.bz2
skyhanni-fe21cf0a129ed824de22d8ef426422fce9d90c12.zip
Fix item cooldowns for items with no UUID (#508)
Fixed ability cooldown not working for some items. #508
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt5
1 files changed, 3 insertions, 2 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 96f9d729b..492da55c7 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
@@ -22,6 +22,7 @@ import at.hannibal2.skyhanni.utils.LorenzUtils.equalsOneOf
import at.hannibal2.skyhanni.utils.LorenzUtils.round
import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName
import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getAbilityScrolls
+import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getItemId
import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getItemUuid
import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
import net.minecraft.client.Minecraft
@@ -292,8 +293,8 @@ class ItemAbilityCooldown {
val stack = event.stack
val guiOpen = Minecraft.getMinecraft().currentScreen != null
- val uuid = stack.getItemUuid()
- val list = items.filter { it.key.getItemUuid() == uuid }
+ val uuid = stack.getItemUuid() ?: stack.getItemId() ?: return
+ val list = items.filter { (it.key.getItemUuid() ?: it.key.getItemId()) == uuid }
.firstNotNullOfOrNull { it.value } ?: return
for (itemText in list) {