diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-12-21 02:31:59 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-12-21 02:31:59 +0100 |
commit | 5de98b869c621f71a389f1aae2175547a83926bc (patch) | |
tree | 264c64cf85cfa297b3892b8aadd8fc37caa29280 /src/main/java/at/hannibal2/skyhanni/features | |
parent | 0b9eb5560844675e44ef794aa8cf5dd40fdf6ee0 (diff) | |
download | skyhanni-5de98b869c621f71a389f1aae2175547a83926bc.tar.gz skyhanni-5de98b869c621f71a389f1aae2175547a83926bc.tar.bz2 skyhanni-5de98b869c621f71a389f1aae2175547a83926bc.zip |
Fixed Fire Veil effect and item ability cooldown not working when clicking in the air.
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
2 files changed, 10 insertions, 14 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/FireVeilWandParticles.kt b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/FireVeilWandParticles.kt index 9154df2e5..2bbf80502 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/FireVeilWandParticles.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/FireVeilWandParticles.kt @@ -4,7 +4,7 @@ import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.config.features.itemability.FireVeilWandConfig.DisplayEntry import at.hannibal2.skyhanni.data.ClickType -import at.hannibal2.skyhanni.events.BlockClickEvent +import at.hannibal2.skyhanni.events.ItemClickEvent import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent import at.hannibal2.skyhanni.events.ReceiveParticleEvent import at.hannibal2.skyhanni.utils.ConfigUtils @@ -35,15 +35,14 @@ class FireVeilWandParticles { } @SubscribeEvent - fun onBlockClick(event: BlockClickEvent) { + fun onItemClick(event: ItemClickEvent) { if (!LorenzUtils.inSkyBlock) return + if (event.clickType != ClickType.RIGHT_CLICK) return - if (event.clickType == ClickType.RIGHT_CLICK) { - val internalName = event.itemInHand?.getInternalName() ?: return + val internalName = event.itemInHand?.getInternalName() ?: return - if (internalName == item) { - lastClick = System.currentTimeMillis() - } + if (internalName == item) { + lastClick = System.currentTimeMillis() } } 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 237fca803..08e2b9820 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 @@ -1,8 +1,8 @@ package at.hannibal2.skyhanni.features.itemabilities.abilitycooldown import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.data.ClickType import at.hannibal2.skyhanni.data.ItemRenderBackground.Companion.background -import at.hannibal2.skyhanni.events.BlockClickEvent import at.hannibal2.skyhanni.events.ItemClickEvent import at.hannibal2.skyhanni.events.LorenzActionBarEvent import at.hannibal2.skyhanni.events.LorenzChatEvent @@ -159,13 +159,10 @@ class ItemAbilityCooldown { } @SubscribeEvent - fun onBlockClickSend(event: BlockClickEvent) { - handleItemClick(event.itemInHand) - } - - @SubscribeEvent fun onItemClick(event: ItemClickEvent) { - handleItemClick(event.itemInHand) + if (event.clickType == ClickType.RIGHT_CLICK) { + handleItemClick(event.itemInHand) + } } private fun handleItemClick(itemInHand: ItemStack?) { |