aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorraaaaaven <168305416+raaaaaven@users.noreply.github.com>2024-07-28 11:21:27 +0100
committerGitHub <noreply@github.com>2024-07-28 12:21:27 +0200
commit32d3a6ae845475284cc5f72dac5649d732c223b5 (patch)
treedf3f67f204ca5ad02ab6266c4d597fedd04aa872 /src/main/java
parentb75c249c2b5f6a319c076b6dfbb4ae9003814fe1 (diff)
downloadskyhanni-32d3a6ae845475284cc5f72dac5649d732c223b5.tar.gz
skyhanni-32d3a6ae845475284cc5f72dac5649d732c223b5.tar.bz2
skyhanni-32d3a6ae845475284cc5f72dac5649d732c223b5.zip
Feature: Thunder Bottle Charged Notification (#2234)
Co-authored-by: Thunderblade73 <85900443+Thunderblade73@users.noreply.github.com> Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java')
-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
+}