aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/ShiftClickEquipment.kt27
1 files changed, 15 insertions, 12 deletions
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 f96405aad..a472d4b90 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ShiftClickEquipment.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ShiftClickEquipment.kt
@@ -3,6 +3,7 @@ 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 net.minecraft.client.Minecraft
import net.minecraft.client.gui.inventory.GuiChest
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
@@ -11,9 +12,10 @@ class ShiftClickEquipment {
@SubscribeEvent
fun onSlotClick(event: GuiContainerEvent.SlotClickEvent) {
- if (event.gui !is GuiChest) return
+ if (!LorenzUtils.inSkyBlock) return
+ if (!SkyHanniMod.feature.inventory.shiftClickForEquipment) return
- val chestName = InventoryUtils.openInventoryName()
+ if (event.gui !is GuiChest) return
val slot = event.slot ?: return
@@ -21,15 +23,16 @@ class ShiftClickEquipment {
if (slot.stack == null) return
- if (SkyHanniMod.feature.inventory.shiftClickForEquipment && chestName.startsWith("Your Equipment")) {
- Minecraft.getMinecraft().playerController.windowClick(
- event.container.windowId,
- event.slot.slotNumber,
- event.clickedButton,
- 1,
- Minecraft.getMinecraft().thePlayer
- )
- event.isCanceled = true
- }
+ 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
+ )
}
} \ No newline at end of file