Skip to content

Commit

Permalink
Added cookie buff
Browse files Browse the repository at this point in the history
  • Loading branch information
j10a1n15 committed Dec 8, 2023
1 parent bfcf6ed commit 954cb83
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ object CustomScoreboardUtils {
fun getTablistFooter(): String {
val tabList = Minecraft.getMinecraft().ingameGUI.tabList as AccessorGuiPlayerTabOverlay
if (tabList.footer_skyhanni == null) return ""
return tabList.footer_skyhanni.formattedText
return tabList.footer_skyhanni.formattedText.replace("§r", "")
}

class UndetectedScoreboardLines(message: String) : Exception(message)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,9 @@ enum class Events(private val displayLine: Supplier<List<String>>, private val s
{
listOf(ScoreboardData.sidebarLinesFormatted.firstOrNull { it.startsWith("§6Spooky Festival§f") }
?: "<hidden>") + // Time
("§r§r§7Your Candy: ") +
(CustomScoreboardUtils.getTablistFooter().split("\n").firstOrNull { it.startsWith("§r§r§7Your Candy:") }
?.removePrefix("§r§r§7Your Candy:") ?: "§cCandy not found") // Candy
("§7Your Candy: ") +
(CustomScoreboardUtils.getTablistFooter().split("\n").firstOrNull { it.startsWith("§7Your Candy:") }
?.removePrefix("§7Your Candy:") ?: "§cCandy not found") // Candy
},
{
ScoreboardData.sidebarLinesFormatted.any { it.startsWith("§6Spooky Festival§f") }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,30 @@ enum class ScoreboardElements(
},
"Power: Sighted"
),
COOKIE(
{
val timeLine = CustomScoreboardUtils.getTablistFooter().split("\n")
.nextAfter("§d§lCookie Buff") ?: "<hidden>"

listOf(
"§d§lCookie Buff" to AlignmentEnum.LEFT
) + when (timeLine.contains("Not active")){
true -> listOf(" §7- §cNot active" to AlignmentEnum.LEFT)
false -> listOf(" §7- §e${timeLine.substringAfter("§d§lCookie Buff").trim()}" to AlignmentEnum.LEFT)
}
},
{
if (config.informationFilteringConfig.hideEmptyLines){
CustomScoreboardUtils.getTablistFooter().split("\n").any {
CustomScoreboardUtils.getTablistFooter().split("\n").nextAfter("§d§lCookie Buff")?.contains(it)
?: false
}
} else {
true
}
},
"§d§lCookie Buff\n §f3days, 17hours"
),
EMPTY_LINE2(
{
listOf("<empty>" to AlignmentEnum.LEFT)
Expand Down

0 comments on commit 954cb83

Please sign in to comment.