aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2025-10-16 16:58:38 +0200
committerLinnea Gräf <nea@nea.moe>2025-10-16 16:58:38 +0200
commit1c062469ef2102e378fe9acceeadf73445db4b7e (patch)
tree3cbe7d53af3c0edde2742fcbf17ace633d6d1a3b /src
parentf857d37a7eeb23dba7cf73fcb6261b2ae0759739 (diff)
downloadFirmament-1c062469ef2102e378fe9acceeadf73445db4b7e.tar.gz
Firmament-1c062469ef2102e378fe9acceeadf73445db4b7e.tar.bz2
Firmament-1c062469ef2102e378fe9acceeadf73445db4b7e.zip
fix: slot binding not working with "only in inv" set
Diffstat (limited to 'src')
-rw-r--r--src/main/kotlin/features/inventory/SlotLocking.kt4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/kotlin/features/inventory/SlotLocking.kt b/src/main/kotlin/features/inventory/SlotLocking.kt
index 903b184..87edbe1 100644
--- a/src/main/kotlin/features/inventory/SlotLocking.kt
+++ b/src/main/kotlin/features/inventory/SlotLocking.kt
@@ -18,9 +18,11 @@ import kotlinx.serialization.json.int
import kotlinx.serialization.serializer
import net.minecraft.client.gl.RenderPipelines
import net.minecraft.client.gui.screen.ingame.HandledScreen
+import net.minecraft.client.gui.screen.ingame.InventoryScreen
import net.minecraft.entity.player.PlayerInventory
import net.minecraft.item.ItemStack
import net.minecraft.screen.GenericContainerScreenHandler
+import net.minecraft.screen.PlayerScreenHandler
import net.minecraft.screen.slot.Slot
import net.minecraft.screen.slot.SlotActionType
import net.minecraft.util.Identifier
@@ -276,7 +278,7 @@ object SlotLocking {
it.actionType == SlotActionType.QUICK_MOVE || (it.actionType == SlotActionType.PICKUP && !TConfig.slotBindRequireShift)
if (!isValidAction) return
val handler = MC.handledScreen?.screenHandler ?: return
- if (TConfig.slotBindOnlyInInv && handler.slots.any { it.inventory !is PlayerInventory })
+ if (TConfig.slotBindOnlyInInv && handler !is PlayerScreenHandler)
return
val slot = it.slot
if (slot != null && it.slot.inventory is PlayerInventory) {