diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
3 files changed, 32 insertions, 15 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/ShiftClickBrewing.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/ShiftClickBrewing.kt new file mode 100644 index 000000000..0e7337bc0 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ShiftClickBrewing.kt @@ -0,0 +1,27 @@ +package at.hannibal2.skyhanni.features.inventory + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.events.GuiContainerEvent +import at.hannibal2.skyhanni.utils.InventoryUtils +import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.LorenzUtils.makeShiftClick +import net.minecraft.client.gui.inventory.GuiChest +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +class ShiftClickBrewing { + + @SubscribeEvent + fun onSlotClick(event: GuiContainerEvent.SlotClickEvent) { + if (!LorenzUtils.inSkyBlock) return + if (!SkyHanniMod.feature.inventory.shiftClickBrewing) return + + if (event.gui !is GuiChest) return + + if (event.slot == null) return + + val chestName = InventoryUtils.openInventoryName() + if (!chestName.startsWith("Brewing Stand")) return + + event.makeShiftClick() + } +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/ShiftClickEquipment.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/ShiftClickEquipment.kt index a472d4b90..4f9b08b20 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ShiftClickEquipment.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ShiftClickEquipment.kt @@ -4,7 +4,7 @@ import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.LorenzUtils -import net.minecraft.client.Minecraft +import at.hannibal2.skyhanni.utils.LorenzUtils.makeShiftClick import net.minecraft.client.gui.inventory.GuiChest import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -26,13 +26,6 @@ class ShiftClickEquipment { val chestName = InventoryUtils.openInventoryName() if (!chestName.startsWith("Your Equipment")) return - event.isCanceled = true - Minecraft.getMinecraft().playerController.windowClick( - event.container.windowId, - event.slot.slotNumber, - event.clickedButton, - 1, - Minecraft.getMinecraft().thePlayer - ) + event.makeShiftClick() } -}
\ No newline at end of file +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/ShiftClickNPCSell.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/ShiftClickNPCSell.kt index 9a18572b1..5e6c8bf6b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ShiftClickNPCSell.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ShiftClickNPCSell.kt @@ -6,9 +6,9 @@ import at.hannibal2.skyhanni.events.InventoryCloseEvent import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.LorenzUtils.makeShiftClick import at.hannibal2.skyhanni.utils.StringUtils.matches import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern -import net.minecraft.client.Minecraft import net.minecraftforge.fml.common.eventhandler.SubscribeEvent object ShiftClickNPCSell { @@ -46,9 +46,6 @@ object ShiftClickNPCSell { if (slot.slotNumber == slot.slotIndex) return - event.isCanceled = true - Minecraft.getMinecraft().playerController.windowClick( - event.container.windowId, event.slot.slotNumber, event.clickedButton, 1, Minecraft.getMinecraft().thePlayer - ) + event.makeShiftClick() } } |
