aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils
diff options
context:
space:
mode:
authorThunderblade73 <85900443+Thunderblade73@users.noreply.github.com>2024-03-30 01:01:51 +0100
committerGitHub <noreply@github.com>2024-03-30 01:01:51 +0100
commited07b78b83aaa736c860a7aa510e578f46c62514 (patch)
tree1182af2c071d709096d99bd54e78428e28a48b50 /src/main/java/at/hannibal2/skyhanni/utils
parentd54e1bb0625c8d786a687707371f31e4ac62c9d0 (diff)
downloadskyhanni-ed07b78b83aaa736c860a7aa510e578f46c62514.tar.gz
skyhanni-ed07b78b83aaa736c860a7aa510e578f46c62514.tar.bz2
skyhanni-ed07b78b83aaa736c860a7aa510e578f46c62514.zip
aprilfoolsjoke-words (#1314)
Co-authored-by: Linnea Gräf <nea@nea.moe> Co-authored-by: Cal <cwolfson58@gmail.com> Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt
index 6249ec54a..048100f71 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt
@@ -7,6 +7,7 @@ import at.hannibal2.skyhanni.data.Perk
import at.hannibal2.skyhanni.data.TitleManager
import at.hannibal2.skyhanni.events.GuiContainerEvent
import at.hannibal2.skyhanni.features.dungeon.DungeonAPI
+import at.hannibal2.skyhanni.features.misc.visualwords.ModifyVisualWords
import at.hannibal2.skyhanni.mixins.transformers.AccessorGuiEditSign
import at.hannibal2.skyhanni.test.TestBingo
import at.hannibal2.skyhanni.utils.ChatUtils.lastButtonClicked
@@ -70,10 +71,20 @@ object LorenzUtils {
val lastWorldSwitch get() = HypixelData.joinedWorld
val isAprilFoolsDay: Boolean
- get() = SkyHanniMod.feature.dev.debug.alwaysFunnyTime || LocalDate.now().let {
- it.month == Month.APRIL && it.dayOfMonth == 1
+ get() {
+ val itsTime = LocalDate.now().let { it.month == Month.APRIL && it.dayOfMonth == 1 }
+ val always = SkyHanniMod.feature.dev.debug.alwaysFunnyTime
+ val never = SkyHanniMod.feature.dev.debug.neverFunnyTime
+ val result = (!never && (always || itsTime))
+ if (previousApril != result) {
+ ModifyVisualWords.textCache.clear()
+ }
+ previousApril = result
+ return result
}
+ private var previousApril = false
+
fun SimpleDateFormat.formatCurrentTime(): String = this.format(System.currentTimeMillis())
fun stripVanillaMessage(originalMessage: String): String {