From d81ac3c4b3ba8881f8dccc122ab773feddf95c0f Mon Sep 17 00:00:00 2001 From: Roman / Linnea Gräf Date: Mon, 15 May 2023 22:50:48 +0200 Subject: Fix compile errors introduced in 068cc5db57af16b25dd5115498ddf0e6f1fc… (#109) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mixins/transformers/AccessorGuiPlayerTabOverlay.java | 4 +++- .../hannibal2/skyhanni/test/command/CopyTabListCommand.kt | 13 ++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) (limited to 'src/main/java/at/hannibal2') diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/AccessorGuiPlayerTabOverlay.java b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/AccessorGuiPlayerTabOverlay.java index 41091580e..d83fe603b 100644 --- a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/AccessorGuiPlayerTabOverlay.java +++ b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/AccessorGuiPlayerTabOverlay.java @@ -8,5 +8,7 @@ import org.spongepowered.asm.mixin.gen.Accessor; @Mixin(GuiPlayerTabOverlay.class) public interface AccessorGuiPlayerTabOverlay { @Accessor("footer") - IChatComponent getFooter(); + IChatComponent getFooter_skyhanni(); + @Accessor("header") + IChatComponent getHeader_skyhanni(); } diff --git a/src/main/java/at/hannibal2/skyhanni/test/command/CopyTabListCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/command/CopyTabListCommand.kt index fc41c4009..c5c94b8a2 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/command/CopyTabListCommand.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/command/CopyTabListCommand.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.test.command +import at.hannibal2.skyhanni.mixins.transformers.AccessorGuiPlayerTabOverlay import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.OSUtils import at.hannibal2.skyhanni.utils.StringUtils.removeColor @@ -15,14 +16,16 @@ object CopyTabListCommand { val tabListLine = if (noColor) line.removeColor() else line if (tabListLine != "") resultList.add("'$tabListLine'") } - val tabHeader = Minecraft.getMinecraft().ingameGUI.tabList.header.formattedText - val tabFooter = Minecraft.getMinecraft().ingameGUI.tabList.footer.formattedText - val string = "Header:\n\n" + tabHeader.toString() + "\n\nBody:\n\n" + resultList.joinToString("\n") + "\nFooter:\n\n" + tabFooter.toString() + val tabList = Minecraft.getMinecraft().ingameGUI.tabList as AccessorGuiPlayerTabOverlay + val tabHeader = tabList.header_skyhanni.formattedText + val tabFooter = tabList.footer_skyhanni.formattedText + val string = "Header:\n\n$tabHeader\n\nBody:\n\n${resultList.joinToString("\n")}\nFooter:\n\n$tabFooter" OSUtils.copyToClipboard(string) - LorenzUtils.chat("§e[SkyHanni] tablist copied into the clipboard!") + LorenzUtils.chat("§e[SkyHanni] Tab list copied into the clipboard!") } catch (_: Throwable) { - LorenzUtils.chat("§c[SkyHanni] Nothing in tablist") + // TODO: Note: why are we ignoring this exception? This user facing error message seems out of place to me + LorenzUtils.chat("§c[SkyHanni] Nothing in tab list") } } } \ No newline at end of file -- cgit