diff options
Diffstat (limited to 'src/main/kotlin/features/inventory')
| -rw-r--r-- | src/main/kotlin/features/inventory/WardrobeKeybinds.kt | 2 | ||||
| -rw-r--r-- | src/main/kotlin/features/inventory/buttons/InventoryButtons.kt | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/main/kotlin/features/inventory/WardrobeKeybinds.kt b/src/main/kotlin/features/inventory/WardrobeKeybinds.kt index b3d4bfd..8d4760b 100644 --- a/src/main/kotlin/features/inventory/WardrobeKeybinds.kt +++ b/src/main/kotlin/features/inventory/WardrobeKeybinds.kt @@ -1,6 +1,7 @@ package moe.nea.firmament.features.inventory import org.lwjgl.glfw.GLFW +import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen import net.minecraft.world.item.Items import moe.nea.firmament.annotations.Subscribe import moe.nea.firmament.events.HandledScreenKeyPressedEvent @@ -29,6 +30,7 @@ object WardrobeKeybinds { @Subscribe fun switchSlot(event: HandledScreenKeyPressedEvent) { if (MC.player == null || MC.world == null || MC.interactionManager == null) return + if (event.screen !is AbstractContainerScreen<*>) return val regex = Regex("Wardrobe \\([12]/2\\)") if (!regex.matches(event.screen.title.string)) return diff --git a/src/main/kotlin/features/inventory/buttons/InventoryButtons.kt b/src/main/kotlin/features/inventory/buttons/InventoryButtons.kt index fa376bc..eaa6138 100644 --- a/src/main/kotlin/features/inventory/buttons/InventoryButtons.kt +++ b/src/main/kotlin/features/inventory/buttons/InventoryButtons.kt @@ -11,6 +11,7 @@ import moe.nea.firmament.annotations.Subscribe import moe.nea.firmament.events.HandledScreenClickEvent import moe.nea.firmament.events.HandledScreenForegroundEvent import moe.nea.firmament.events.HandledScreenPushREIEvent +import moe.nea.firmament.impl.v1.FirmamentAPIImpl import moe.nea.firmament.util.MC import moe.nea.firmament.util.ScreenUtil import moe.nea.firmament.util.TimeMark @@ -40,9 +41,11 @@ object InventoryButtons { ) fun getValidButtons(screen: AbstractContainerScreen<*>): Sequence<InventoryButton> { - return DConfig.data.buttons.asSequence().filter { button -> - button.isValid() && (!TConfig.onlyInv || screen is InventoryScreen) + if (TConfig.onlyInv && screen !is InventoryScreen) return emptySequence() + if (FirmamentAPIImpl.extensions.any { it.shouldHideInventoryButtons(screen) }) { + return emptySequence() } + return DConfig.data.buttons.asSequence().filter(InventoryButton::isValid) } |
