From 704b90b4a25a88cb3ad33fa77a1b9423caaf472d Mon Sep 17 00:00:00 2001 From: Empa <42304516+ItsEmpa@users.noreply.github.com> Date: Thu, 4 Apr 2024 20:30:46 +0200 Subject: Feature: No Bits Warning (#1286) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../skyhanni/features/misc/NoBitsWarning.kt | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/main/java/at/hannibal2/skyhanni/features/misc/NoBitsWarning.kt (limited to 'src/main/java/at/hannibal2/skyhanni/features') 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 +} -- cgit