diff options
author | J10a1n15 <45315647+j10a1n15@users.noreply.github.com> | 2024-05-04 00:23:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-04 00:23:53 +0200 |
commit | 7bde2f2e3fcb8a90270f5e865137ef47361838b4 (patch) | |
tree | 1763750cd4e18b8dfcd7cd604981acaf99bd99e0 /src/main/java/at/hannibal2/skyhanni | |
parent | ff039f98215522a24e2c5ddfed2551e002388c41 (diff) | |
download | skyhanni-7bde2f2e3fcb8a90270f5e865137ef47361838b4.tar.gz skyhanni-7bde2f2e3fcb8a90270f5e865137ef47361838b4.tar.bz2 skyhanni-7bde2f2e3fcb8a90270f5e865137ef47361838b4.zip |
Fix: Vanilla Scoreboard not reappearing when leaving SkyBlock (#1673)
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/CustomScoreboard.kt | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/CustomScoreboard.kt b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/CustomScoreboard.kt index 7dca6c1b4..05e2b518a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/CustomScoreboard.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/CustomScoreboard.kt @@ -26,8 +26,10 @@ import at.hannibal2.skyhanni.events.DebugDataCollectEvent import at.hannibal2.skyhanni.events.GuiPositionMovedEvent import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.LorenzTickEvent +import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.ConditionalUtils.onToggle +import at.hannibal2.skyhanni.utils.DelayedRun.runDelayed import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.RenderUtils.HorizontalAlignment import at.hannibal2.skyhanni.utils.RenderUtils.VerticalAlignment @@ -39,6 +41,7 @@ import com.google.gson.JsonPrimitive import net.minecraftforge.client.GuiIngameForge import net.minecraftforge.client.event.RenderGameOverlayEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent +import kotlin.time.Duration.Companion.seconds typealias ScoreboardElementType = Pair<String, HorizontalAlignment> @@ -173,6 +176,13 @@ class CustomScoreboard { } @SubscribeEvent + fun onWorldChange(event: LorenzWorldChangeEvent) { + runDelayed(2.seconds) { + if (!LorenzUtils.inSkyBlock) dirty = true + } + } + + @SubscribeEvent fun onDebugDataCollect(event: DebugDataCollectEvent) { event.title("Custom Scoreboard") event.addIrrelevant { |