From 8964cf9bd7647fd9216ce0c3e5af229dabfa5fb5 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Mon, 20 Nov 2023 00:56:40 +0100 Subject: Fixed ender chest not reopening correctly after opening gui editor. --- src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/data') diff --git a/src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt b/src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt index 2486c7eee..7477d74bb 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt @@ -19,9 +19,13 @@ import net.minecraft.client.renderer.GlStateManager import net.minecraftforge.fml.common.eventhandler.EventPriority import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import java.util.UUID +import kotlin.time.Duration.Companion.milliseconds import kotlin.time.Duration.Companion.minutes class GuiEditManager { + + var lastHotkeyPressed = SimpleTimeMark.farPast() + @SubscribeEvent fun onKeyClick(event: LorenzKeyPressEvent) { if (!LorenzUtils.inSkyBlock) return @@ -33,8 +37,11 @@ class GuiEditManager { if (it is GuiEditSign && !it.isRancherSign()) return } + if (lastHotkeyPressed.passedSince() < 500.milliseconds) return if (NEUItems.neuHasFocus()) return + lastHotkeyPressed = SimpleTimeMark.now() + Minecraft.getMinecraft().thePlayer.closeScreen() openGuiPositionEditor(hotkeyReminder = false) } @@ -71,8 +78,8 @@ class GuiEditManager { lastHotkeyReminded = SimpleTimeMark.now() LorenzUtils.chat( "§eTo edit hidden GUI elements:\n" + - " §7- §e1. Set a key in /sh edit.\n" + - " §7- §e2. Click that key while the GUI element is visible." + " §7- §e1. Set a key in /sh edit.\n" + + " §7- §e2. Click that key while the GUI element is visible." ) } } -- cgit