From 93fd9ece889b68349bb3b2bdfc6943e5c356424d Mon Sep 17 00:00:00 2001 From: NetheriteMiner <88792142+NetheriteMiner@users.noreply.github.com> Date: Mon, 19 Jun 2023 15:20:02 -0400 Subject: Fix coins displaying null in RPC (#246) --- .../at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features') diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt index 20f203bb7..d114913bb 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt @@ -108,7 +108,7 @@ enum class DiscordStatus(private val displayMessageSupplier: Supplier?) } if (coins == "1") { lastKnownDisplayStrings[PURSE] = "1 Coin" - } else if (coins != "") { + } else if (coins != "" && coins != null) { lastKnownDisplayStrings[PURSE] = "$coins Coins" } lastKnownDisplayStrings[PURSE] ?: "" -- cgit From 9594c23b95f795b25adc8be415ed38f1f46634fb Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Mon, 19 Jun 2023 21:20:18 +0200 Subject: addSeparators --- .../hannibal2/skyhanni/features/slayer/SlayerItemProfitTracker.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features') diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerItemProfitTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerItemProfitTracker.kt index c04d662e2..9faa3511b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerItemProfitTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerItemProfitTracker.kt @@ -196,7 +196,7 @@ object SlayerItemProfitTracker { val renderable = if (inventoryOpen) Renderable.clickAndHover( text, listOf( - "§7Dropped §e$timesDropped §7times.", + "§7Dropped §e${timesDropped.addSeparators()} §7times.", "§7Your drop rate: §c$perBoss", "", "§eClick to " + (if (hidden) "show" else "hide") + "!", @@ -250,8 +250,8 @@ object SlayerItemProfitTracker { val slayerCompletedCount = itemLog.slayerCompletedCount addAsSingletonList( Renderable.hoverTips( - "§7Bosses killed: §e$slayerCompletedCount", - listOf("§7You killed the $itemLogCategory boss", "§e$slayerCompletedCount §7times.") + "§7Bosses killed: §e${slayerCompletedCount.addSeparators()}", + listOf("§7You killed the $itemLogCategory boss", "§e${slayerCompletedCount.addSeparators()} §7times.") ) ) -- cgit From 13c636ff4ad49403c078b208dabd0b87972b0440 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Thu, 22 Jun 2023 14:23:26 +0200 Subject: Added rift timer --- .../hannibal2/skyhanni/features/rift/RiftTimer.kt | 99 ++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 src/main/java/at/hannibal2/skyhanni/features/rift/RiftTimer.kt (limited to 'src/main/java/at/hannibal2/skyhanni/features') diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftTimer.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/RiftTimer.kt new file mode 100644 index 000000000..d1fcc758d --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/RiftTimer.kt @@ -0,0 +1,99 @@ +package at.hannibal2.skyhanni.features.rift + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.data.IslandType +import at.hannibal2.skyhanni.events.ConfigLoadEvent +import at.hannibal2.skyhanni.events.GuiRenderEvent +import at.hannibal2.skyhanni.events.LorenzActionBarEvent +import at.hannibal2.skyhanni.events.LorenzChatEvent +import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.RenderUtils.renderStrings +import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher +import at.hannibal2.skyhanni.utils.TimeUtils +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +class RiftTimer { + private val config get() = SkyHanniMod.feature.rift.timer + private var display = listOf() + private var maxTime = 0L + private var latestTime = 0L + private val changes = mutableMapOf() + + @SubscribeEvent + fun onConfigLoad(event: ConfigLoadEvent) { + display = emptyList() + } + + @SubscribeEvent + fun onChatMessage(event: LorenzChatEvent) { + if (!isEnabled()) return + + val message = event.message + " §r§7You have §r§a(?