diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java index 8b1ad26fdbc0..3a9b05e07503 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java @@ -757,6 +757,12 @@ public static class CustomScoreboard { ) public List textFormat = new ArrayList<>(Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 14, 15, 16, 17, 18, 19, 20, 21)); + @Expose + @ConfigOption(name = "Hide Vanilla Scoreboard", desc = "Hide the vanilla scoreboard.") + @ConfigEditorBoolean + @FeatureToggle + public boolean hideVanillaScoreboard = false; + @Expose @ConfigOption(name = "Max Party List", desc = "Max number of party members to show in the party list. (You are not included)") @ConfigEditorSlider( diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/CustomScoreboard.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/CustomScoreboard.kt index 0dd3e7fd363d..b3613443c9cd 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/CustomScoreboard.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/CustomScoreboard.kt @@ -26,11 +26,11 @@ package at.hannibal2.skyhanni.features.misc import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.data.HypixelData -import at.hannibal2.skyhanni.data.ScoreboardData -import at.hannibal2.skyhanni.data.PurseAPI +import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.data.MayorElection import at.hannibal2.skyhanni.data.PartyAPI -import at.hannibal2.skyhanni.data.IslandType +import at.hannibal2.skyhanni.data.PurseAPI +import at.hannibal2.skyhanni.data.ScoreboardData import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.RenderUtils.renderStringsAndItems @@ -38,9 +38,10 @@ import at.hannibal2.skyhanni.utils.StringUtils.firstLetterUppercase import at.hannibal2.skyhanni.utils.TabListData import at.hannibal2.skyhanni.utils.TimeUtils.formatted import io.github.moulberry.notenoughupdates.util.SkyBlockTime +import net.minecraftforge.client.GuiIngameForge +import net.minecraftforge.client.event.RenderGameOverlayEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import net.minecraftforge.fml.common.gameevent.TickEvent -import java.util.* import java.util.function.Supplier private val config get() = SkyHanniMod.feature.misc.customScoreboard @@ -200,7 +201,9 @@ enum class CustomScoreboardElements ( 13 ), SLAYER( - { listOf("§7Slayer") }, + { + listOf("§7Slayer") + }, listOf(IslandType.HUB, IslandType.SPIDER_DEN, IslandType.THE_PARK, IslandType.THE_END, IslandType.CRIMSON_ISLE), 0, 14 @@ -391,6 +394,13 @@ class CustomScoreboard { return newList } + @SubscribeEvent + fun onRenderScoreboard(event: RenderGameOverlayEvent.Post){ + if (event.type == RenderGameOverlayEvent.ElementType.HELMET && config.hideVanillaScoreboard && LorenzUtils.inSkyBlock){ + GuiIngameForge.renderObjective = false + } + } + private fun isEnabled() : Boolean{ return config.enabled && LorenzUtils.inSkyBlock }