aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/data
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/BitsAPI.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/HotmData.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/MiningAPI.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/PurseAPI.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/ScoreboardData.kt8
5 files changed, 16 insertions, 16 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/BitsAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/BitsAPI.kt
index c7c8925c7..72928fd25 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/BitsAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/BitsAPI.kt
@@ -6,7 +6,7 @@ import at.hannibal2.skyhanni.data.FameRanks.getFameRankByNameOrNull
import at.hannibal2.skyhanni.events.BitsUpdateEvent
import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent
import at.hannibal2.skyhanni.events.LorenzChatEvent
-import at.hannibal2.skyhanni.events.ScoreboardChangeEvent
+import at.hannibal2.skyhanni.events.ScoreboardUpdateEvent
import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
import at.hannibal2.skyhanni.test.command.ErrorManager
import at.hannibal2.skyhanni.utils.CollectionUtils.nextAfter
@@ -143,9 +143,9 @@ object BitsAPI {
)
@SubscribeEvent
- fun onScoreboardChange(event: ScoreboardChangeEvent) {
+ fun onScoreboardChange(event: ScoreboardUpdateEvent) {
if (!isEnabled()) return
- for (line in event.newList) {
+ for (line in event.scoreboard) {
val message = line.trimWhiteSpace().removeResets()
bitsScoreboardPattern.matchMatcher(message) {
diff --git a/src/main/java/at/hannibal2/skyhanni/data/HotmData.kt b/src/main/java/at/hannibal2/skyhanni/data/HotmData.kt
index d232e49bb..3f2d54b31 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/HotmData.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/HotmData.kt
@@ -11,7 +11,7 @@ import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent
import at.hannibal2.skyhanni.events.IslandChangeEvent
import at.hannibal2.skyhanni.events.LorenzChatEvent
import at.hannibal2.skyhanni.events.ProfileJoinEvent
-import at.hannibal2.skyhanni.events.ScoreboardChangeEvent
+import at.hannibal2.skyhanni.events.ScoreboardUpdateEvent
import at.hannibal2.skyhanni.features.gui.customscoreboard.ScoreboardPattern
import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
import at.hannibal2.skyhanni.test.command.ErrorManager
@@ -644,10 +644,10 @@ enum class HotmData(
}
@SubscribeEvent
- fun onScoreboardUpdate(event: ScoreboardChangeEvent) {
+ fun onScoreboardUpdate(event: ScoreboardUpdateEvent) {
if (!LorenzUtils.inSkyBlock) return
- event.newList.matchFirst(ScoreboardPattern.powderPattern) {
+ event.scoreboard.matchFirst(ScoreboardPattern.powderPattern) {
val type = HotmAPI.Powder.entries.firstOrNull { it.lowName == group("type") } ?: return
val amount = group("amount").formatLong()
val difference = amount - type.getCurrent()
diff --git a/src/main/java/at/hannibal2/skyhanni/data/MiningAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/MiningAPI.kt
index 289c9c58b..47d38ef74 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/MiningAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/MiningAPI.kt
@@ -7,7 +7,7 @@ import at.hannibal2.skyhanni.events.LorenzChatEvent
import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent
import at.hannibal2.skyhanni.events.PlaySoundEvent
-import at.hannibal2.skyhanni.events.ScoreboardChangeEvent
+import at.hannibal2.skyhanni.events.ScoreboardUpdateEvent
import at.hannibal2.skyhanni.events.ServerBlockChangeEvent
import at.hannibal2.skyhanni.events.mining.OreMinedEvent
import at.hannibal2.skyhanni.features.gui.customscoreboard.ScoreboardPattern
@@ -102,8 +102,8 @@ object MiningAPI {
fun inColdIsland() = inAnyIsland(IslandType.DWARVEN_MINES, IslandType.MINESHAFT)
@SubscribeEvent
- fun onScoreboardChange(event: ScoreboardChangeEvent) {
- val newCold = event.newList.matchFirst(ScoreboardPattern.coldPattern) {
+ fun onScoreboardChange(event: ScoreboardUpdateEvent) {
+ val newCold = event.scoreboard.matchFirst(ScoreboardPattern.coldPattern) {
group("cold").toInt().absoluteValue
} ?: return
diff --git a/src/main/java/at/hannibal2/skyhanni/data/PurseAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/PurseAPI.kt
index 5c7f94aed..a5a8eb184 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/PurseAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/PurseAPI.kt
@@ -3,7 +3,7 @@ package at.hannibal2.skyhanni.data
import at.hannibal2.skyhanni.events.InventoryCloseEvent
import at.hannibal2.skyhanni.events.PurseChangeCause
import at.hannibal2.skyhanni.events.PurseChangeEvent
-import at.hannibal2.skyhanni.events.ScoreboardChangeEvent
+import at.hannibal2.skyhanni.events.ScoreboardUpdateEvent
import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
import at.hannibal2.skyhanni.utils.NumberUtil.formatDouble
import at.hannibal2.skyhanni.utils.NumberUtil.million
@@ -36,8 +36,8 @@ object PurseAPI {
}
@SubscribeEvent
- fun onScoreboardChange(event: ScoreboardChangeEvent) {
- event.newList.matchFirst(coinsPattern) {
+ fun onScoreboardChange(event: ScoreboardUpdateEvent) {
+ event.scoreboard.matchFirst(coinsPattern) {
val newPurse = group("coins").formatDouble()
val diff = newPurse - currentPurse
if (diff == 0.0) return
diff --git a/src/main/java/at/hannibal2/skyhanni/data/ScoreboardData.kt b/src/main/java/at/hannibal2/skyhanni/data/ScoreboardData.kt
index 72abf6bab..b24f08b04 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/ScoreboardData.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/ScoreboardData.kt
@@ -2,8 +2,8 @@ package at.hannibal2.skyhanni.data
import at.hannibal2.skyhanni.api.event.HandleEvent
import at.hannibal2.skyhanni.events.LorenzTickEvent
-import at.hannibal2.skyhanni.events.ScoreboardChangeEvent
-import at.hannibal2.skyhanni.events.ScoreboardRawChangeEvent
+import at.hannibal2.skyhanni.events.RawScoreboardUpdateEvent
+import at.hannibal2.skyhanni.events.ScoreboardUpdateEvent
import at.hannibal2.skyhanni.events.minecraft.packet.PacketReceivedEvent
import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
import at.hannibal2.skyhanni.utils.RegexUtils.matches
@@ -74,14 +74,14 @@ object ScoreboardData {
val list = fetchScoreboardLines().reversed()
val semiFormatted = list.map { cleanSB(it) }
if (semiFormatted != sidebarLines) {
- ScoreboardRawChangeEvent(sidebarLines, semiFormatted).postAndCatch()
+ RawScoreboardUpdateEvent(semiFormatted).postAndCatch()
sidebarLines = semiFormatted
}
sidebarLinesRaw = list
val new = formatLines(list)
if (new != sidebarLinesFormatted) {
- ScoreboardChangeEvent(sidebarLinesFormatted, new).postAndCatch()
+ ScoreboardUpdateEvent(new).postAndCatch()
sidebarLinesFormatted = new
}
}