aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/data
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-12-21 02:31:59 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-12-21 02:31:59 +0100
commit5de98b869c621f71a389f1aae2175547a83926bc (patch)
tree264c64cf85cfa297b3892b8aadd8fc37caa29280 /src/main/java/at/hannibal2/skyhanni/data
parent0b9eb5560844675e44ef794aa8cf5dd40fdf6ee0 (diff)
downloadskyhanni-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/data')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/ItemClickData.kt14
1 files changed, 7 insertions, 7 deletions
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