diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/test')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt | 8 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/test/TestExportTools.kt | 8 |
2 files changed, 6 insertions, 10 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt index 137dc2f01..c6b734a78 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt @@ -7,6 +7,7 @@ import at.hannibal2.skyhanni.config.ConfigManager import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.config.core.config.Position import at.hannibal2.skyhanni.data.HypixelData +import at.hannibal2.skyhanni.events.GuiKeyPressEvent import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent @@ -47,9 +48,7 @@ import at.hannibal2.skyhanni.utils.SimpleTimeMark import at.hannibal2.skyhanni.utils.SoundUtils import kotlinx.coroutines.launch import net.minecraft.client.Minecraft -import net.minecraft.client.gui.inventory.GuiContainer import net.minecraft.nbt.NBTTagCompound -import net.minecraftforge.client.event.GuiScreenEvent import net.minecraftforge.common.MinecraftForge import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import java.io.File @@ -412,10 +411,9 @@ class SkyHanniDebugsAndTests { } @SubscribeEvent - fun onKeybind(event: GuiScreenEvent.KeyboardInputEvent.Post) { + fun onKeybind(event: GuiKeyPressEvent) { if (!debugConfig.copyInternalName.isKeyHeld()) return - val gui = event.gui as? GuiContainer ?: return - val focussedSlot = gui.slotUnderMouse ?: return + val focussedSlot = event.guiContainer.slotUnderMouse ?: return val stack = focussedSlot.stack ?: return val internalName = stack.getInternalNameOrNull() ?: return val rawInternalName = internalName.asString() diff --git a/src/main/java/at/hannibal2/skyhanni/test/TestExportTools.kt b/src/main/java/at/hannibal2/skyhanni/test/TestExportTools.kt index 304d4646f..44a147c07 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/TestExportTools.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/TestExportTools.kt @@ -2,6 +2,7 @@ package at.hannibal2.skyhanni.test import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator +import at.hannibal2.skyhanni.events.GuiKeyPressEvent import at.hannibal2.skyhanni.test.command.CopyItemCommand.copyItemToClipboard import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.ItemStackTypeAdapterFactory @@ -13,10 +14,8 @@ import at.hannibal2.skyhanni.utils.OSUtils import at.hannibal2.skyhanni.utils.fromJson import com.google.gson.GsonBuilder import com.google.gson.JsonElement -import net.minecraft.client.gui.inventory.GuiContainer import net.minecraft.item.ItemStack import net.minecraft.nbt.NBTTagCompound -import net.minecraftforge.client.event.GuiScreenEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import java.io.InputStreamReader import java.io.Reader @@ -52,10 +51,9 @@ object TestExportTools { } @SubscribeEvent - fun onKeybind(event: GuiScreenEvent.KeyboardInputEvent.Post) { + fun onKeybind(event: GuiKeyPressEvent) { if (!config.copyItemDataCompressed.isKeyHeld() && !config.copyItemData.isKeyHeld()) return - val gui = event.gui as? GuiContainer ?: return - val stack = gui.slotUnderMouse?.stack ?: return + val stack = event.guiContainer.slotUnderMouse?.stack ?: return if (config.copyItemData.isKeyHeld()) { copyItemToClipboard(stack) return |