aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features
diff options
context:
space:
mode:
authorCalMWolfs <94038482+CalMWolfs@users.noreply.github.com>2024-02-20 00:59:39 +1100
committerGitHub <noreply@github.com>2024-02-19 14:59:39 +0100
commitc19a902d2ef4aa93ff2d3cc93230f067e9315b71 (patch)
tree588e197fa91adc383223948d003db565b5e9f5a5 /src/main/java/at/hannibal2/skyhanni/features
parentab769839034888bc10ddfb2ef815be2400d64641 (diff)
downloadskyhanni-c19a902d2ef4aa93ff2d3cc93230f067e9315b71.tar.gz
skyhanni-c19a902d2ef4aa93ff2d3cc93230f067e9315b71.tar.bz2
skyhanni-c19a902d2ef4aa93ff2d3cc93230f067e9315b71.zip
Created ActionBarUpdateEvent and used it. #977
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/chat/SkyblockXPInChat.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostCounter.kt8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/RiftTimer.kt7
4 files changed, 13 insertions, 12 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/SkyblockXPInChat.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/SkyblockXPInChat.kt
index 8859220ee..190ddb493 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/chat/SkyblockXPInChat.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/chat/SkyblockXPInChat.kt
@@ -2,7 +2,7 @@ package at.hannibal2.skyhanni.features.chat
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.data.ActionBarStatsData
-import at.hannibal2.skyhanni.events.ActionBarValueUpdate
+import at.hannibal2.skyhanni.events.ActionBarValueUpdateEvent
import at.hannibal2.skyhanni.utils.ChatUtils
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
@@ -11,7 +11,7 @@ class SkyblockXPInChat {
val config get() = SkyHanniMod.feature.chat.skyBlockXPInChat
@SubscribeEvent
- fun onActionBarValueUpdate(event: ActionBarValueUpdate) {
+ fun onActionBarValueUpdate(event: ActionBarValueUpdateEvent) {
if (event.updated != ActionBarStatsData.SKYBLOCK_XP) return
if (!config) return
ChatUtils.chat(event.updated.value)
diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostCounter.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostCounter.kt
index 0364bda1a..733be8cd0 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostCounter.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostCounter.kt
@@ -6,10 +6,10 @@ import at.hannibal2.skyhanni.config.features.combat.ghostcounter.GhostCounterCon
import at.hannibal2.skyhanni.data.IslandType
import at.hannibal2.skyhanni.data.ProfileStorageData
import at.hannibal2.skyhanni.data.SkillExperience
+import at.hannibal2.skyhanni.events.ActionBarUpdateEvent
import at.hannibal2.skyhanni.events.ConfigLoadEvent
import at.hannibal2.skyhanni.events.GuiRenderEvent
import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent
-import at.hannibal2.skyhanni.events.LorenzActionBarEvent
import at.hannibal2.skyhanni.events.LorenzChatEvent
import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.events.PurseChangeCause
@@ -333,12 +333,12 @@ object GhostCounter {
}
@SubscribeEvent
- fun onActionBar(event: LorenzActionBarEvent) {
+ fun onActionBarUpdate(event: ActionBarUpdateEvent) {
if (!isEnabled()) return
if (!inMist) return
- combatSectionPattern.matchMatcher(event.message) {
+ combatSectionPattern.matchMatcher(event.actionBar) {
if (group("skillName").lowercase() != "combat") return
- parseCombatSection(event.message)
+ parseCombatSection(event.actionBar)
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt
index 2e7a4b8cc..180a09ca2 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt
@@ -2,8 +2,8 @@ package at.hannibal2.skyhanni.features.itemabilities.abilitycooldown
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.data.ItemRenderBackground.Companion.background
+import at.hannibal2.skyhanni.events.ActionBarUpdateEvent
import at.hannibal2.skyhanni.events.ItemClickEvent
-import at.hannibal2.skyhanni.events.LorenzActionBarEvent
import at.hannibal2.skyhanni.events.LorenzChatEvent
import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent
@@ -191,10 +191,10 @@ class ItemAbilityCooldown {
}
@SubscribeEvent
- fun onActionBar(event: LorenzActionBarEvent) {
+ fun onActionBarUpdate(event: ActionBarUpdateEvent) {
if (!isEnabled()) return
- val message: String = event.message
+ val message: String = event.actionBar
handleOldAbilities(message)
when {
diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/RiftTimer.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/RiftTimer.kt
index e7f8ad5a1..c995fa405 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/RiftTimer.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/RiftTimer.kt
@@ -1,8 +1,8 @@
package at.hannibal2.skyhanni.features.rift.everywhere
+import at.hannibal2.skyhanni.events.ActionBarUpdateEvent
import at.hannibal2.skyhanni.events.ConfigLoadEvent
import at.hannibal2.skyhanni.events.GuiRenderEvent
-import at.hannibal2.skyhanni.events.LorenzActionBarEvent
import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent
import at.hannibal2.skyhanni.features.rift.RiftAPI
import at.hannibal2.skyhanni.utils.ConditionalUtils
@@ -36,10 +36,11 @@ class RiftTimer {
currentTime = 0
}
+ //todo use ActionBarValueUpdateEvent
@SubscribeEvent
- fun onActionBar(event: LorenzActionBarEvent) {
+ fun onActionBarUpdate(event: ActionBarUpdateEvent) {
if (!isEnabled()) return
- for (entry in event.message.split(" ")) {
+ for (entry in event.actionBar.split(" ")) {
timePattern.matchMatcher(entry) {
val color = group("color")
val newTime = getTime(group("time"))