From 17b3e2353e05db79b2e9087971e933d04120a814 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Fri, 15 Dec 2023 22:48:15 +0100 Subject: Added New Year Cake Reminder --- src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt | 2 + .../java/at/hannibal2/skyhanni/config/Storage.java | 3 + .../config/features/event/winter/WinterConfig.java | 6 ++ .../features/event/winter/NewYearCakeReminder.kt | 81 ++++++++++++++++++++++ 4 files changed, 92 insertions(+) create mode 100644 src/main/java/at/hannibal2/skyhanni/features/event/winter/NewYearCakeReminder.kt (limited to 'src/main/java/at/hannibal2') diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt index 64b3020b4..fad364296 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt @@ -118,6 +118,7 @@ import at.hannibal2.skyhanni.features.event.lobby.waypoints.christmas.PresentWay import at.hannibal2.skyhanni.features.event.lobby.waypoints.halloween.BasketWaypoints import at.hannibal2.skyhanni.features.event.spook.TheGreatSpook import at.hannibal2.skyhanni.features.event.winter.JyrreTimer +import at.hannibal2.skyhanni.features.event.winter.NewYearCakeReminder import at.hannibal2.skyhanni.features.event.winter.UniqueGiftCounter import at.hannibal2.skyhanni.features.fame.AccountUpgradeReminder import at.hannibal2.skyhanni.features.fame.CityProjectFeatures @@ -676,6 +677,7 @@ class SkyHanniMod { loadModule(HighlightPlaceableNpcs()) loadModule(PresentWaypoints()) loadModule(JyrreTimer()) + loadModule(NewYearCakeReminder()) init() diff --git a/src/main/java/at/hannibal2/skyhanni/config/Storage.java b/src/main/java/at/hannibal2/skyhanni/config/Storage.java index a01c8d7e5..4a9c94fb5 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/Storage.java +++ b/src/main/java/at/hannibal2/skyhanni/config/Storage.java @@ -92,6 +92,9 @@ public class Storage { @Expose public int amountGifted = 0; + + @Expose + public int cakeCollectedYear = 0; } @Expose diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/event/winter/WinterConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/event/winter/WinterConfig.java index ae95b62f3..458813f42 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/event/winter/WinterConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/event/winter/WinterConfig.java @@ -38,4 +38,10 @@ public class WinterConfig { @Expose public Position islandCloseTimePosition = new Position(10, 10, false, true); + @Expose + @ConfigOption(name = "New Year Cake Reminder", desc = "Reminds while the new year cake can be collected in the hub.") + @ConfigEditorBoolean + @FeatureToggle + public boolean newYearCakeReminder = true; + } diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/winter/NewYearCakeReminder.kt b/src/main/java/at/hannibal2/skyhanni/features/event/winter/NewYearCakeReminder.kt new file mode 100644 index 000000000..d5c4e7739 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/event/winter/NewYearCakeReminder.kt @@ -0,0 +1,81 @@ +package at.hannibal2.skyhanni.features.event.winter + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.data.IslandType +import at.hannibal2.skyhanni.data.ProfileStorageData +import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent +import at.hannibal2.skyhanni.events.LorenzChatEvent +import at.hannibal2.skyhanni.events.LorenzTickEvent +import at.hannibal2.skyhanni.events.ScoreboardChangeEvent +import at.hannibal2.skyhanni.features.fame.ReminderUtils +import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland +import at.hannibal2.skyhanni.utils.SimpleTimeMark +import at.hannibal2.skyhanni.utils.StringUtils.matches +import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern +import io.github.moulberry.notenoughupdates.util.SkyBlockTime +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent +import kotlin.time.Duration.Companion.seconds + +class NewYearCakeReminder { + private val config get() = SkyHanniMod.feature.event.winter + private val sidebarDetectionPattern by RepoPattern.pattern( + "event.winter.newyearcake.reminder.sidebar", + "§dNew Year Event!§f (?