diff options
author | Linnea Gräf <nea@nea.moe> | 2025-06-26 16:37:57 +0200 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2025-06-26 16:38:33 +0200 |
commit | 2de6cfbe5eeab499461d2dff09006f2ddf9ba8cb (patch) | |
tree | e4c960b43e9baa1cc5e2048639a0eea054b0c127 /src/main/kotlin/util | |
parent | e4490f23bd3091e147ddc4525ba1edb87ce41930 (diff) | |
download | Firmament-2de6cfbe5eeab499461d2dff09006f2ddf9ba8cb.tar.gz Firmament-2de6cfbe5eeab499461d2dff09006f2ddf9ba8cb.tar.bz2 Firmament-2de6cfbe5eeab499461d2dff09006f2ddf9ba8cb.zip |
fix: wardrobe cleanup (cancel old click, use array for keys, use library methods)
Diffstat (limited to 'src/main/kotlin/util')
-rw-r--r-- | src/main/kotlin/util/mc/SlotUtils.kt | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/main/kotlin/util/mc/SlotUtils.kt b/src/main/kotlin/util/mc/SlotUtils.kt index 4709dcf..9eb4918 100644 --- a/src/main/kotlin/util/mc/SlotUtils.kt +++ b/src/main/kotlin/util/mc/SlotUtils.kt @@ -1,5 +1,6 @@ package moe.nea.firmament.util.mc +import org.lwjgl.glfw.GLFW import net.minecraft.screen.ScreenHandler import net.minecraft.screen.slot.Slot import net.minecraft.screen.slot.SlotActionType @@ -10,7 +11,7 @@ object SlotUtils { MC.interactionManager?.clickSlot( handler.syncId, this.id, - 2, + GLFW.GLFW_MOUSE_BUTTON_MIDDLE, SlotActionType.CLONE, MC.player ) @@ -20,14 +21,25 @@ object SlotUtils { MC.interactionManager?.clickSlot( handler.syncId, this.id, hotbarIndex, SlotActionType.SWAP, - MC.player) + MC.player + ) } fun Slot.clickRightMouseButton(handler: ScreenHandler) { MC.interactionManager?.clickSlot( handler.syncId, this.id, - 1, + GLFW.GLFW_MOUSE_BUTTON_RIGHT, + SlotActionType.PICKUP, + MC.player + ) + } + + fun Slot.clickLeftMouseButton(handler: ScreenHandler) { + MC.interactionManager?.clickSlot( + handler.syncId, + this.id, + GLFW.GLFW_MOUSE_BUTTON_LEFT, SlotActionType.PICKUP, MC.player ) |