From a793c14d3b246afbbb657e6a919806194c4cf64c Mon Sep 17 00:00:00 2001 From: Walker Selby Date: Tue, 17 Oct 2023 13:17:24 +0100 Subject: Internal Change: Dev List from REPO (#545) moved contributor list into repo #545 --- .../misc/compacttablist/AdvancedPlayerList.kt | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features') diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/AdvancedPlayerList.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/AdvancedPlayerList.kt index d4f994a24..6c60de732 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/AdvancedPlayerList.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/AdvancedPlayerList.kt @@ -6,6 +6,7 @@ import at.hannibal2.skyhanni.data.FriendAPI import at.hannibal2.skyhanni.data.GuildAPI import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.data.PartyAPI +import at.hannibal2.skyhanni.events.RepositoryReloadEvent import at.hannibal2.skyhanni.features.misc.MarkedPlayerManager import at.hannibal2.skyhanni.test.SkyHanniDebugsAndTests import at.hannibal2.skyhanni.utils.KeyboardManager @@ -13,7 +14,9 @@ import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import at.hannibal2.skyhanni.utils.StringUtils.removeColor +import at.hannibal2.skyhanni.utils.jsonobjects.ContributorListJson import com.google.common.cache.CacheBuilder +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import java.util.concurrent.TimeUnit import kotlin.random.Random @@ -131,13 +134,14 @@ object AdvancedPlayerList { return denyKeyPressed || !SkyHanniDebugsAndTests.globalRender } - private val listOfSkyHanniDevsOrPeopeWhoKnowALotAboutModdingSeceneButAreBadInCoding = listOf( - "hannibal2", - "CalMWolfs", - "HiZe_", - "lrg89", - "Eisengolem", - ) + private var contributors: List = emptyList() + + @SubscribeEvent + fun onRepoReload(event: RepositoryReloadEvent) { + event.getConstant("ContributorList")?.usernames?.let { + contributors = it + } + } private fun createCustomName(data: PlayerData): String { val playerName = if (config.useLevelColorForName) { @@ -157,7 +161,7 @@ object AdvancedPlayerList { val score = socialScore(data.name) suffix += " " + getSocialScoreIcon(score) } - if (config.markSkyHanniDevs && data.name in listOfSkyHanniDevsOrPeopeWhoKnowALotAboutModdingSeceneButAreBadInCoding) { + if (config.markSkyHanniContributors && data.name in contributors) { suffix += " §c:O" } -- cgit