diff options
author | Thunderblade73 <85900443+Thunderblade73@users.noreply.github.com> | 2024-02-10 00:24:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-10 00:24:52 +0100 |
commit | 4559e5ff05e19817a21ae49f1c0d8a97d273f6a1 (patch) | |
tree | e72dac91d07fc84bea80548c89e13276caa68b81 /src/main/java/at/hannibal2/skyhanni/features/fame | |
parent | d3a7cc4ab970b457b7950489da781539e45e0dce (diff) | |
download | skyhanni-4559e5ff05e19817a21ae49f1c0d8a97d273f6a1.tar.gz skyhanni-4559e5ff05e19817a21ae49f1c0d8a97d273f6a1.tar.bz2 skyhanni-4559e5ff05e19817a21ae49f1c0d8a97d273f6a1.zip |
Splitting many utils functions from LorenzUtils up into other classes: ChatUtils, CollectionUtils, ConditionalUtils. And code cleanup #978
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/fame')
3 files changed, 11 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/fame/AccountUpgradeReminder.kt b/src/main/java/at/hannibal2/skyhanni/features/fame/AccountUpgradeReminder.kt index 6d010fae7..a383d8683 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fame/AccountUpgradeReminder.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fame/AccountUpgradeReminder.kt @@ -7,6 +7,7 @@ import at.hannibal2.skyhanni.events.InventoryCloseEvent import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.events.LorenzTickEvent +import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.SimpleTimeMark @@ -17,6 +18,7 @@ import kotlin.time.Duration.Companion.days import kotlin.time.Duration.Companion.seconds class AccountUpgradeReminder { + private var inInventory = false private var duration: Duration? = null private var lastReminderSend = SimpleTimeMark.farPast() @@ -30,7 +32,6 @@ class AccountUpgradeReminder { } } - @SubscribeEvent fun onTick(event: LorenzTickEvent) { if (!LorenzUtils.inSkyBlock) return @@ -53,7 +54,7 @@ class AccountUpgradeReminder { if (lastReminderSend.passedSince() < 30.seconds) return lastReminderSend = SimpleTimeMark.now() - LorenzUtils.clickableChat( + ChatUtils.clickableChat( "The §a$upgrade §eupgrade has completed! §c(Click to disable these reminders)", "shstopaccountupgradereminder" ) @@ -107,6 +108,7 @@ class AccountUpgradeReminder { } companion object { + private val durationRegex = "§8Duration: (\\d{1,3})d".toRegex() private val startedRegex = "§eYou started the §r§a(.+) §r§eupgrade!".toRegex() private val claimedRegex = "§eYou claimed the §r§a.+ §r§eupgrade!".toRegex() diff --git a/src/main/java/at/hannibal2/skyhanni/features/fame/CityProjectFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/fame/CityProjectFeatures.kt index 5bd8be726..bef023755 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fame/CityProjectFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fame/CityProjectFeatures.kt @@ -9,12 +9,13 @@ import at.hannibal2.skyhanni.events.InventoryCloseEvent import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.features.bazaar.BazaarApi +import at.hannibal2.skyhanni.utils.ChatUtils +import at.hannibal2.skyhanni.utils.CollectionUtils.addAsSingletonList import at.hannibal2.skyhanni.utils.ItemUtils import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzColor import at.hannibal2.skyhanni.utils.LorenzUtils -import at.hannibal2.skyhanni.utils.LorenzUtils.addAsSingletonList import at.hannibal2.skyhanni.utils.NEUItems import at.hannibal2.skyhanni.utils.NumberUtil import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators @@ -33,6 +34,7 @@ import net.minecraft.item.ItemStack import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class CityProjectFeatures { + private var display = emptyList<List<Any>>() private var inInventory = false private var lastReminderSend = 0L @@ -48,10 +50,11 @@ class CityProjectFeatures { ) companion object { + private val config get() = SkyHanniMod.feature.event.cityProject fun disable() { config.dailyReminder = false - LorenzUtils.chat("Disabled city project reminder messages!") + ChatUtils.chat("Disabled city project reminder messages!") } } @@ -76,7 +79,7 @@ class CityProjectFeatures { if (lastReminderSend + 30_000 > System.currentTimeMillis()) return lastReminderSend = System.currentTimeMillis() - LorenzUtils.clickableChat( + ChatUtils.clickableChat( "Daily City Project Reminder! (Click here to disable this reminder)", "shstopcityprojectreminder" ) diff --git a/src/main/java/at/hannibal2/skyhanni/features/fame/ReminderUtils.kt b/src/main/java/at/hannibal2/skyhanni/features/fame/ReminderUtils.kt index e68edf39e..1fdb7ad16 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fame/ReminderUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fame/ReminderUtils.kt @@ -5,6 +5,7 @@ import at.hannibal2.skyhanni.features.rift.RiftAPI import at.hannibal2.skyhanni.utils.LorenzUtils object ReminderUtils { + // TODO: add arachne fight, add slayer boss spawned fun isBusy(): Boolean = LorenzUtils.inDungeons || LorenzUtils.inKuudraFight || FarmingContestAPI.inContest || RiftAPI.inRift() |