diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-03-28 18:29:13 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-03-28 18:29:13 +0200 |
commit | ace3681e98df11c8b54463a1c58bb921d9328f5e (patch) | |
tree | 0bd85ef4ca44c3d46bf763d88f488547a6cff40c /src/main/java/at/hannibal2/skyhanni/data | |
parent | cb926f8fe8c469db2b33300dc104de51343ad3d8 (diff) | |
parent | 8f8ffb3314d7822c3f4a4c9b7988526d25b3f393 (diff) | |
download | skyhanni-ace3681e98df11c8b54463a1c58bb921d9328f5e.tar.gz skyhanni-ace3681e98df11c8b54463a1c58bb921d9328f5e.tar.bz2 skyhanni-ace3681e98df11c8b54463a1c58bb921d9328f5e.zip |
Merge remote-tracking branch 'origin/beta' into beta
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/ItemClickData.kt | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/ItemClickData.kt b/src/main/java/at/hannibal2/skyhanni/data/ItemClickData.kt index a2a22a865..fc68e1a52 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/ItemClickData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/ItemClickData.kt @@ -2,12 +2,14 @@ package at.hannibal2.skyhanni.data import at.hannibal2.skyhanni.events.BlockClickEvent import at.hannibal2.skyhanni.events.EntityClickEvent +import at.hannibal2.skyhanni.events.ItemClickEvent import at.hannibal2.skyhanni.events.PacketEvent import at.hannibal2.skyhanni.utils.LorenzUtils 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 @@ -21,11 +23,14 @@ class ItemClickData { val position = packet.position.toLorenzVec() BlockClickEvent(ClickType.RIGHT_CLICK, position, packet.stack).postAndCatch() } + val itemInHand = Minecraft.getMinecraft().thePlayer.heldItem if (packet is C07PacketPlayerDigging && packet.status == C07PacketPlayerDigging.Action.START_DESTROY_BLOCK) { val position = packet.position.toLorenzVec() - val itemInHand = Minecraft.getMinecraft().thePlayer.heldItem BlockClickEvent(ClickType.LEFT_CLICK, position, itemInHand).postAndCatch() } + if (packet is C0APacketAnimation) { + ItemClickEvent(itemInHand).postAndCatch() + } } @SubscribeEvent |