aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/data/ItemClickData.kt
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-12-24 15:16:47 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-12-24 15:16:47 +0100
commit2b581ce23be9425f1a22255ea923b028042a0838 (patch)
tree71ea57ef99d95ee0b1a50eb72458cc9853a439b2 /src/main/java/at/hannibal2/skyhanni/data/ItemClickData.kt
parent40f8dd3b9c3727b03d8fbf1f2882d88bb9a19c6a (diff)
downloadskyhanni-2b581ce23be9425f1a22255ea923b028042a0838.tar.gz
skyhanni-2b581ce23be9425f1a22255ea923b028042a0838.tar.bz2
skyhanni-2b581ce23be9425f1a22255ea923b028042a0838.zip
Fixed left click ability detection of Gyro Wand.
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data/ItemClickData.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/ItemClickData.kt5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/ItemClickData.kt b/src/main/java/at/hannibal2/skyhanni/data/ItemClickData.kt
index 3ffc44719..0219634b4 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/ItemClickData.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/ItemClickData.kt
@@ -10,6 +10,7 @@ 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
@@ -30,6 +31,10 @@ class ItemClickData {
if (packet is C07PacketPlayerDigging && packet.status == C07PacketPlayerDigging.Action.START_DESTROY_BLOCK) {
val position = packet.position.toLorenzVec()
BlockClickEvent(ClickType.LEFT_CLICK, position, InventoryUtils.getItemInHand()).postAndCatch()
+ ItemClickEvent(InventoryUtils.getItemInHand(), ClickType.RIGHT_CLICK).postAndCatch()
+ }
+ if (packet is C0APacketAnimation) {
+ ItemClickEvent(InventoryUtils.getItemInHand(), ClickType.LEFT_CLICK).postAndCatch()
}
}