Skip to content

Commit

Permalink
added hide vanilla scoreboard
Browse files Browse the repository at this point in the history
  • Loading branch information
j10a1n15 committed Nov 1, 2023
1 parent 2902511 commit aa0142c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,12 @@ public static class CustomScoreboard {
)
public List<Integer> 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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,22 @@ 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
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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit aa0142c

Please sign in to comment.