diff options
Diffstat (limited to 'src/main')
3 files changed, 29 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/HarpFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/HarpFeatures.kt index 44f8a51b6..71ce9c41e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/HarpFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/HarpFeatures.kt @@ -152,6 +152,17 @@ object HarpFeatures { @SubscribeEvent fun onSlotClick(event: GuiContainerEvent.SlotClickEvent) { if (!LorenzUtils.inSkyBlock) return + + if (isHarpGui(InventoryUtils.openInventoryName())) { + if (config.keybinds) { + // needed to not send duplicate clicks via keybind feature + if (event.clickTypeEnum == GuiContainerEvent.ClickType.HOTBAR) { + event.cancel() + return + } + } + } + if (!config.quickRestart) return if (!isMenuGui(InventoryUtils.openInventoryName())) return if (event.slot?.slotNumber != closeButtonSlot) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryInventory.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryInventory.kt index 42dcdae8a..587f265da 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryInventory.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryInventory.kt @@ -92,7 +92,11 @@ object ChocolateFactoryInventory { val slotNumber = slot.slotNumber if (!config.useMiddleClick) return if (slotNumber in ChocolateFactoryAPI.noPickblockSlots && - (slotNumber != ChocolateFactoryAPI.timeTowerIndex || event.clickedButton == 1)) return + (slotNumber != ChocolateFactoryAPI.timeTowerIndex || event.clickedButton == 1) + ) return + + // this would break ChocolateFactoryKeybinds otherwise + if (event.clickTypeEnum == GuiContainerEvent.ClickType.HOTBAR) return event.makePickblock() } diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryKeybinds.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryKeybinds.kt index ca4ec9705..2c0920db3 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryKeybinds.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryKeybinds.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.inventory.chocolatefactory +import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.GuiKeyPressEvent import at.hannibal2.skyhanni.utils.KeyboardManager.isKeyClicked import at.hannibal2.skyhanni.utils.LorenzUtils @@ -40,6 +41,18 @@ object ChocolateFactoryKeybinds { } } + @SubscribeEvent + fun onSlotClick(event: GuiContainerEvent.SlotClickEvent) { + if (!LorenzUtils.inSkyBlock) return + if (!config.enabled) return + if (!ChocolateFactoryAPI.inChocolateFactory) return + + // needed to not send duplicate clicks via keybind feature + if (event.clickTypeEnum == GuiContainerEvent.ClickType.HOTBAR) { + event.cancel() + } + } + private fun getKey(index: Int) = when (index) { 0 -> config.key1 1 -> config.key2 |