From 9ca1458eaeecebbd349fc6780c3f0d22b43dd05f Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Mon, 27 May 2024 08:32:31 +0200 Subject: added workarounds for profile data not loaded problems --- src/main/java/at/hannibal2/skyhanni/utils/TabListData.kt | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/main/java/at/hannibal2/skyhanni/utils') diff --git a/src/main/java/at/hannibal2/skyhanni/utils/TabListData.kt b/src/main/java/at/hannibal2/skyhanni/utils/TabListData.kt index ea930bee4..22032ff84 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/TabListData.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/TabListData.kt @@ -20,6 +20,7 @@ import net.minecraft.world.WorldSettings import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import net.minecraftforge.fml.relauncher.Side import net.minecraftforge.fml.relauncher.SideOnly +import kotlin.time.Duration.Companion.seconds object TabListData { private var tablistCache = emptyList() @@ -126,6 +127,9 @@ object TabListData { if (tablistCache != tabList) { tablistCache = tabList TabListUpdateEvent(getTabList()).postAndCatch() + if (!LorenzUtils.onHypixel) { + workaroundDelayedTabListUpdateAgain() + } } val tabListOverlay = Minecraft.getMinecraft().ingameGUI.tabList as AccessorGuiPlayerTabOverlay @@ -137,4 +141,13 @@ object TabListData { } footer = tabFooter } + + private fun workaroundDelayedTabListUpdateAgain() { + DelayedRun.runDelayed(2.seconds) { + if (LorenzUtils.onHypixel) { + println("workaroundDelayedTabListUpdateAgain") + TabListUpdateEvent(getTabList()).postAndCatch() + } + } + } } -- cgit