diff options
| author | CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> | 2024-06-08 12:18:03 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-08 12:18:03 +1000 |
| commit | aaca5f08d47732b3db5329a3a9404281b21d2f55 (patch) | |
| tree | 6e9888c91928ba5e49e1d736b28fe0f4c847faa8 /src/main/java/at/hannibal2/skyhanni/features/fame | |
| parent | 0c53ce8afdd5f64d2764d5ce0d4f2f2a59a7b06e (diff) | |
| download | skyhanni-aaca5f08d47732b3db5329a3a9404281b21d2f55.tar.gz skyhanni-aaca5f08d47732b3db5329a3a9404281b21d2f55.tar.bz2 skyhanni-aaca5f08d47732b3db5329a3a9404281b21d2f55.zip | |
Backend: Add annotation to smaller modules (#2022)
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/fame')
| -rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/fame/AccountUpgradeReminder.kt | 24 | ||||
| -rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/fame/CityProjectFeatures.kt | 16 |
2 files changed, 20 insertions, 20 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 b26a05094..b1001fe52 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.SecondPassedEvent +import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.LorenzUtils @@ -17,12 +18,18 @@ import kotlin.time.Duration import kotlin.time.Duration.Companion.days import kotlin.time.Duration.Companion.seconds -class AccountUpgradeReminder { +@SkyHanniModule +object AccountUpgradeReminder { private var inInventory = false private var duration: Duration? = null private var lastReminderSend = SimpleTimeMark.farPast() + // TODO repo patterns + 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() + // TODO: find a way to save SimpleTimeMark directly in the config private var nextCompletionTime: SimpleTimeMark? get() = ProfileStorageData.playerSpecific?.nextAccountUpgradeCompletionTime?.asTimeMark() @@ -104,17 +111,10 @@ class AccountUpgradeReminder { nextCompletionTime = SimpleTimeMark.farPast() } - 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() + private fun isEnabled() = SkyHanniMod.feature.misc.accountUpgradeReminder - private fun isEnabled() = SkyHanniMod.feature.misc.accountUpgradeReminder - - fun disable() { - SkyHanniMod.feature.misc.accountUpgradeReminder = false - ChatUtils.chat("Disabled account upgrade reminder.") - } + fun disable() { + SkyHanniMod.feature.misc.accountUpgradeReminder = false + ChatUtils.chat("Disabled account upgrade reminder.") } } 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 7b2ef9bce..88d9f52a8 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fame/CityProjectFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fame/CityProjectFeatures.kt @@ -9,6 +9,7 @@ import at.hannibal2.skyhanni.events.InventoryCloseEvent import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent import at.hannibal2.skyhanni.events.SecondPassedEvent import at.hannibal2.skyhanni.features.inventory.bazaar.BazaarApi +import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.CollectionUtils.addAsSingletonList import at.hannibal2.skyhanni.utils.InventoryUtils.getUpperItems @@ -40,7 +41,10 @@ import net.minecraft.item.ItemStack import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import kotlin.time.Duration.Companion.seconds -class CityProjectFeatures { +@SkyHanniModule +object CityProjectFeatures { + + private val config get() = SkyHanniMod.feature.event.cityProject private var display = emptyList<List<Any>>() private var inInventory = false @@ -56,13 +60,9 @@ class CityProjectFeatures { "§aProject is (?:being built|released)!" ) - companion object { - - private val config get() = SkyHanniMod.feature.event.cityProject - fun disable() { - config.dailyReminder = false - ChatUtils.chat("Disabled city project reminder messages!") - } + fun disable() { + config.dailyReminder = false + ChatUtils.chat("Disabled city project reminder messages!") } @SubscribeEvent |
