diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-01 22:26:31 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-01 22:26:31 +0100 |
commit | e3b0c5d5a0d05017a3f5e8fc8ecf17580e2c5474 (patch) | |
tree | ae5b7c26ecb4be6913256ca43f477167cf890b8d | |
parent | 5c6ac5e309019f8216f5f020c82888d224cee3f9 (diff) | |
download | skyhanni-e3b0c5d5a0d05017a3f5e8fc8ecf17580e2c5474.tar.gz skyhanni-e3b0c5d5a0d05017a3f5e8fc8ecf17580e2c5474.tar.bz2 skyhanni-e3b0c5d5a0d05017a3f5e8fc8ecf17580e2c5474.zip |
Disabled diana warp key while inside every gui.
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowWarpHelper.kt | 2 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/KeyboardManager.kt | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowWarpHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowWarpHelper.kt index 32fa93e6d..0810d53e7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowWarpHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowWarpHelper.kt @@ -8,6 +8,7 @@ import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.sorted import at.hannibal2.skyhanni.utils.LorenzVec import at.hannibal2.skyhanni.utils.SimpleTimeMark +import net.minecraft.client.Minecraft import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import kotlin.time.Duration.Companion.seconds @@ -22,6 +23,7 @@ class BurrowWarpHelper { if (!config.burrowNearestWarp) return if (event.keyCode != config.keyBindWarp) return + if (Minecraft.getMinecraft().currentScreen != null) return currentWarp?.let { if (lastWarpTime.passedSince() > 5.seconds) { diff --git a/src/main/java/at/hannibal2/skyhanni/utils/KeyboardManager.kt b/src/main/java/at/hannibal2/skyhanni/utils/KeyboardManager.kt index 3314bde7f..5078a492f 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/KeyboardManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/KeyboardManager.kt @@ -5,6 +5,7 @@ import at.hannibal2.skyhanni.events.LorenzTickEvent import io.github.moulberry.moulconfig.gui.GuiScreenElementWrapper import io.github.moulberry.moulconfig.internal.KeybindHelper import net.minecraft.client.Minecraft +import net.minecraft.client.gui.GuiChat import net.minecraft.client.settings.KeyBinding import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import org.apache.commons.lang3.SystemUtils @@ -27,8 +28,10 @@ object KeyboardManager { @SubscribeEvent fun onTick(event: LorenzTickEvent) { - val isConfigScreen = Minecraft.getMinecraft().currentScreen is GuiScreenElementWrapper + val currentScreen = Minecraft.getMinecraft().currentScreen + val isConfigScreen = currentScreen is GuiScreenElementWrapper if (isConfigScreen) return + if (currentScreen is GuiChat) return if (Mouse.getEventButtonState() && Mouse.getEventButton() != -1) { |