summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/misc
diff options
context:
space:
mode:
authorEmpa <42304516+ItsEmpa@users.noreply.github.com>2024-04-04 20:30:46 +0200
committerGitHub <noreply@github.com>2024-04-04 20:30:46 +0200
commit704b90b4a25a88cb3ad33fa77a1b9423caaf472d (patch)
treef53caad245fdff5f733c80cc28b04bb8c25bcce2 /src/main/java/at/hannibal2/skyhanni/features/misc
parentd48cf0126f9c163dd85c860004f658167912c85c (diff)
downloadskyhanni-704b90b4a25a88cb3ad33fa77a1b9423caaf472d.tar.gz
skyhanni-704b90b4a25a88cb3ad33fa77a1b9423caaf472d.tar.bz2
skyhanni-704b90b4a25a88cb3ad33fa77a1b9423caaf472d.zip
Feature: No Bits Warning (#1286)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/misc')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/NoBitsWarning.kt30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/NoBitsWarning.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/NoBitsWarning.kt
new file mode 100644
index 000000000..0b2e6069e
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/NoBitsWarning.kt
@@ -0,0 +1,30 @@
+package at.hannibal2.skyhanni.features.misc
+
+import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.events.BitsUpdateEvent
+import at.hannibal2.skyhanni.utils.ChatUtils
+import at.hannibal2.skyhanni.utils.LorenzUtils
+import at.hannibal2.skyhanni.utils.SoundUtils
+import at.hannibal2.skyhanni.utils.SoundUtils.createSound
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
+import kotlin.time.Duration.Companion.seconds
+
+class NoBitsWarning {
+
+ private val config get() = SkyHanniMod.feature.misc.noBitsWarning
+
+ @SubscribeEvent
+ fun onBitsUpdate(event: BitsUpdateEvent) {
+ if (!isEnabled()) return
+ if (event.bitsToClaim != 0) return
+
+ ChatUtils.clickableChat(
+ "§bNo Bits Available! §eClick to run /bz booster cookie.",
+ "bz booster cookie"
+ )
+ LorenzUtils.sendTitle("§bNo Bits Available", 5.seconds)
+ SoundUtils.repeatSound(100,10, createSound("note.pling", 0.6f))
+ }
+
+ private fun isEnabled() = LorenzUtils.inSkyBlock && config
+}