aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/gui
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-06-22 09:20:18 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-06-22 09:20:18 +0200
commitc52a71ee63c633d17d7a935c0aa92ddda904c750 (patch)
treeebe8ee09960c0b3470fbb0042ada56582c315142 /src/main/java/at/hannibal2/skyhanni/features/gui
parentbdb1fedeaed3c13dd8d86217459c25ab8175718f (diff)
downloadskyhanni-c52a71ee63c633d17d7a935c0aa92ddda904c750.tar.gz
skyhanni-c52a71ee63c633d17d7a935c0aa92ddda904c750.tar.bz2
skyhanni-c52a71ee63c633d17d7a935c0aa92ddda904c750.zip
do not use Supplier
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/gui')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardElements.kt5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardEvents.kt6
2 files changed, 4 insertions, 7 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardElements.kt b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardElements.kt
index 6249ac295..116cecd19 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardElements.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardElements.kt
@@ -46,7 +46,6 @@ import at.hannibal2.skyhanni.utils.TabListData
import at.hannibal2.skyhanni.utils.TimeLimitedSet
import at.hannibal2.skyhanni.utils.TimeUtils.format
import at.hannibal2.skyhanni.utils.TimeUtils.formatted
-import java.util.function.Supplier
import kotlin.time.Duration.Companion.seconds
internal var confirmedUnknownLines = listOf<String>()
@@ -75,7 +74,7 @@ private fun onRemoval(line: String) {
internal var amountOfUnknownLines = 0
enum class ScoreboardElement(
- private val displayPair: Supplier<List<ScoreboardElementType>>,
+ private val displayPair: () -> List<ScoreboardElementType>,
val showWhen: () -> Boolean,
private val configLine: String,
) {
@@ -285,7 +284,7 @@ enum class ScoreboardElement(
private fun getPair(): List<ScoreboardElementType> {
return try {
- displayPair.get()
+ displayPair()
} catch (e: NoSuchElementException) {
listOf("<hidden>" to HorizontalAlignment.LEFT)
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardEvents.kt b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardEvents.kt
index d8fdf532b..ebeed5eee 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardEvents.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardEvents.kt
@@ -5,7 +5,6 @@ import at.hannibal2.skyhanni.data.IslandType
import at.hannibal2.skyhanni.data.ScoreboardData
import at.hannibal2.skyhanni.features.dungeon.DungeonAPI
import at.hannibal2.skyhanni.features.gui.customscoreboard.CustomScoreboard.eventsConfig
-import at.hannibal2.skyhanni.features.gui.customscoreboard.ScoreboardEvents.NEW_YEAR
import at.hannibal2.skyhanni.features.gui.customscoreboard.ScoreboardEvents.VOTING
import at.hannibal2.skyhanni.features.gui.customscoreboard.ScoreboardPattern
import at.hannibal2.skyhanni.features.misc.ServerRestartTitle
@@ -19,7 +18,6 @@ import at.hannibal2.skyhanni.utils.RegexUtils.matches
import at.hannibal2.skyhanni.utils.StringUtils.removeColor
import at.hannibal2.skyhanni.utils.StringUtils.removeResets
import at.hannibal2.skyhanni.utils.TabListData
-import java.util.function.Supplier
import at.hannibal2.skyhanni.features.gui.customscoreboard.ScoreboardPattern as SbPattern
/**
@@ -35,7 +33,7 @@ private fun getSbLines(): List<String> {
}
enum class ScoreboardEvents(
- private val displayLine: Supplier<List<String>>,
+ private val displayLine: () -> List<String>,
private val showWhen: () -> Boolean,
private val configLine: String,
) {
@@ -193,7 +191,7 @@ enum class ScoreboardEvents(
override fun toString() = configLine
- fun getLines(): List<String> = displayLine.get()
+ fun getLines(): List<String> = displayLine()
companion object {
fun getEvent() = buildList<ScoreboardEvents?> {