aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/data/ItemClickData.kt
diff options
context:
space:
mode:
authorLorenz <lo.scherf@gmail.com>2022-09-07 11:42:48 +0200
committerLorenz <lo.scherf@gmail.com>2022-09-07 11:42:48 +0200
commit163cc857b0b1e6f52d56e663b8cb1c55f5e1bff2 (patch)
tree27a128342125bade370c1fdf8b5ef0166d86a881 /src/main/java/at/hannibal2/skyhanni/data/ItemClickData.kt
parent2d0f63b156f936e9f056537a67eaa13bffa54c27 (diff)
downloadskyhanni-163cc857b0b1e6f52d56e663b8cb1c55f5e1bff2.tar.gz
skyhanni-163cc857b0b1e6f52d56e663b8cb1c55f5e1bff2.tar.bz2
skyhanni-163cc857b0b1e6f52d56e663b8cb1c55f5e1bff2.zip
Hiding the flame particles when using the Fire Veil Wand ability.
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data/ItemClickData.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/ItemClickData.kt32
1 files changed, 32 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
new file mode 100644
index 000000000..e359c619e
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/data/ItemClickData.kt
@@ -0,0 +1,32 @@
+package at.hannibal2.skyhanni.data
+
+import at.hannibal2.skyhanni.events.ItemClickInHandEvent
+import net.minecraft.client.Minecraft
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
+import net.minecraftforge.fml.common.gameevent.InputEvent
+import org.lwjgl.input.Mouse
+
+class ItemClickData {
+
+ @SubscribeEvent
+ fun onClick(event: InputEvent.MouseInputEvent) {
+ if (!Mouse.getEventButtonState()) return
+
+ val clickType = when (Mouse.getEventButton()) {
+ 0 -> {
+ ItemClickInHandEvent.ClickType.LEFT_CLICK
+ }
+
+ 1 -> {
+ ItemClickInHandEvent.ClickType.RIGHT_CLICK
+ }
+
+ else -> {
+ return
+ }
+ }
+
+ val itemStack = Minecraft.getMinecraft().thePlayer.heldItem
+ ItemClickInHandEvent(clickType, itemStack).postAndCatch()
+ }
+} \ No newline at end of file