aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/misc/MiscConfig.java6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/ThunderBottleNotification.kt32
2 files changed, 38 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/misc/MiscConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/misc/MiscConfig.java
index aff9b4964..6843d0948 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/misc/MiscConfig.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/misc/MiscConfig.java
@@ -273,6 +273,12 @@ public class MiscConfig {
public boolean replaceRomanNumerals = false;
@Expose
+ @ConfigOption(name = "Thunder Bottle", desc = "Show a notification when your Thunder Bottle is fully charged.")
+ @ConfigEditorBoolean
+ @FeatureToggle
+ public boolean thunderBottleNotification = true;
+
+ @Expose
@ConfigOption(name = "Unknown Perkpocalypse Mayor Warning", desc = "Show a warning when the Unknown Perkpocalypse Mayor is unknown.")
@ConfigEditorBoolean
@FeatureToggle
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/ThunderBottleNotification.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/ThunderBottleNotification.kt
new file mode 100644
index 000000000..681f1a0dd
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/ThunderBottleNotification.kt
@@ -0,0 +1,32 @@
+package at.hannibal2.skyhanni.features.misc
+
+import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.events.LorenzChatEvent
+import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
+import at.hannibal2.skyhanni.utils.LorenzUtils
+import at.hannibal2.skyhanni.utils.RegexUtils.matches
+import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
+import kotlin.time.Duration.Companion.seconds
+
+@SkyHanniModule
+object ThunderBottleNotification {
+
+ private val config get() = SkyHanniMod.feature.misc
+
+ private val thunderBottleChargedPattern by RepoPattern.pattern(
+ "thunderbottle.charged",
+ "§e> Your bottle of thunder has fully charged!",
+ )
+
+ @SubscribeEvent
+ fun onChat(event: LorenzChatEvent) {
+ if (!isEnabled()) return
+
+ if (thunderBottleChargedPattern.matches(event.message)) {
+ LorenzUtils.sendTitle("§eThunder Bottle Charged!", 3.seconds)
+ }
+ }
+
+ private fun isEnabled() = LorenzUtils.inSkyBlock && config.thunderBottleNotification
+}