From 5de98b869c621f71a389f1aae2175547a83926bc Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Thu, 21 Dec 2023 02:31:59 +0100 Subject: Fixed Fire Veil effect and item ability cooldown not working when clicking in the air. --- src/main/java/at/hannibal2/skyhanni/data/ItemClickData.kt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/data') diff --git a/src/main/java/at/hannibal2/skyhanni/data/ItemClickData.kt b/src/main/java/at/hannibal2/skyhanni/data/ItemClickData.kt index 3d154666f..3ffc44719 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/ItemClickData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/ItemClickData.kt @@ -10,7 +10,6 @@ import at.hannibal2.skyhanni.utils.toLorenzVec import net.minecraft.client.Minecraft import net.minecraft.network.play.client.C07PacketPlayerDigging import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement -import net.minecraft.network.play.client.C0APacketAnimation import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import net.minecraftforge.fml.common.gameevent.InputEvent import org.lwjgl.input.Mouse @@ -20,17 +19,18 @@ class ItemClickData { @SubscribeEvent fun onItemClickSend(event: PacketEvent.SendEvent) { val packet = event.packet - if (packet is C08PacketPlayerBlockPlacement && packet.placedBlockDirection != 255) { - val position = packet.position.toLorenzVec() - BlockClickEvent(ClickType.RIGHT_CLICK, position, packet.stack).postAndCatch() + if (packet is C08PacketPlayerBlockPlacement) { + if (packet.placedBlockDirection != 255) { + val position = packet.position.toLorenzVec() + BlockClickEvent(ClickType.RIGHT_CLICK, position, packet.stack).postAndCatch() + } else { + ItemClickEvent(InventoryUtils.getItemInHand(), ClickType.RIGHT_CLICK).postAndCatch() + } } if (packet is C07PacketPlayerDigging && packet.status == C07PacketPlayerDigging.Action.START_DESTROY_BLOCK) { val position = packet.position.toLorenzVec() BlockClickEvent(ClickType.LEFT_CLICK, position, InventoryUtils.getItemInHand()).postAndCatch() } - if (packet is C0APacketAnimation) { - ItemClickEvent(InventoryUtils.getItemInHand()).postAndCatch() - } } @SubscribeEvent -- cgit