aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/data
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-05-22 20:06:36 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-05-22 20:06:36 +0200
commiteb68a59b4670d548fa4c0a493ad1d19029faeb5b (patch)
tree392483a857b584efbd8ea50fbfef9cb387e5e805 /src/main/java/at/hannibal2/skyhanni/data
parent2e819d59253f91a5453d50cfaca7f998198a338b (diff)
downloadskyhanni-eb68a59b4670d548fa4c0a493ad1d19029faeb5b.tar.gz
skyhanni-eb68a59b4670d548fa4c0a493ad1d19029faeb5b.tar.bz2
skyhanni-eb68a59b4670d548fa4c0a493ad1d19029faeb5b.zip
Use getItemInHand()
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/ItemClickData.kt7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/ItemClickData.kt b/src/main/java/at/hannibal2/skyhanni/data/ItemClickData.kt
index eb6e20590..842cbcfcc 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/ItemClickData.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/ItemClickData.kt
@@ -4,6 +4,7 @@ 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.InventoryUtils
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.toLorenzVec
import net.minecraft.client.Minecraft
@@ -24,13 +25,11 @@ class ItemClickData {
BlockClickEvent(ClickType.RIGHT_CLICK, position, packet.stack).postAndCatch()
}
if (packet is C07PacketPlayerDigging && packet.status == C07PacketPlayerDigging.Action.START_DESTROY_BLOCK) {
- val itemInHand = Minecraft.getMinecraft().thePlayer.heldItem
val position = packet.position.toLorenzVec()
- BlockClickEvent(ClickType.LEFT_CLICK, position, itemInHand).postAndCatch()
+ BlockClickEvent(ClickType.LEFT_CLICK, position, InventoryUtils.getItemInHand()).postAndCatch()
}
if (packet is C0APacketAnimation) {
- val itemInHand = Minecraft.getMinecraft().thePlayer.heldItem
- ItemClickEvent(itemInHand).postAndCatch()
+ ItemClickEvent(InventoryUtils.getItemInHand()).postAndCatch()
}
}