aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt
diff options
context:
space:
mode:
authorJ10a1n15 <45315647+j10a1n15@users.noreply.github.com>2024-01-02 23:08:15 +0100
committerGitHub <noreply@github.com>2024-01-02 23:08:15 +0100
commit48e85f9790a4408eaff0fc70041e5353b951ef8c (patch)
treec850e22df56ba5d3a56be11725c46c4454663039 /src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt
parente44ac393a54019a26d55fa509d84c9ccba0114bf (diff)
downloadskyhanni-48e85f9790a4408eaff0fc70041e5353b951ef8c.tar.gz
skyhanni-48e85f9790a4408eaff0fc70041e5353b951ef8c.tar.bz2
skyhanni-48e85f9790a4408eaff0fc70041e5353b951ef8c.zip
Backend: Add Dark Auction as IslandType and fix IslandType detection for dungeons (#823)
Added Dark Auction as IslandType and fix IslandType detection for dungeons. #823
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt b/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt
index b92647b9a..60630a675 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt
@@ -15,6 +15,7 @@ import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
import at.hannibal2.skyhanni.utils.StringUtils.removeColor
import at.hannibal2.skyhanni.utils.TabListData
+import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern
import com.google.gson.JsonObject
import io.github.moulberry.notenoughupdates.NotEnoughUpdates
import net.minecraft.client.Minecraft
@@ -25,9 +26,10 @@ import net.minecraftforge.fml.common.network.FMLNetworkEvent
import kotlin.concurrent.thread
class HypixelData {
- // TODO USE SH-REPO
- private val tabListProfilePattern = "§e§lProfile: §r§a(?<profile>.*)".toPattern()
- private val lobbyTypePattern = "(?<lobbyType>.*lobby)\\d+".toPattern()
+ private val group = RepoPattern.group("data.hypixeldata")
+ private val tabListProfilePattern by group.pattern("tablistprofile", "§e§lProfile: §r§a(?<profile>.*)")
+ private val lobbyTypePattern by group.pattern("lobbytype", "(?<lobbyType>.*lobby)\\d+")
+ private val islandNamePattern by group.pattern("islandname", "§b§l(Area|Dungeon): §r§7(?<island>.*)")
private var lastLocRaw = 0L
@@ -209,8 +211,8 @@ class HypixelData {
var newIsland = ""
var guesting = false
for (line in TabListData.getTabList()) {
- if (line.startsWith("§b§lArea: ")) {
- newIsland = line.split(": ")[1].removeColor()
+ islandNamePattern.matchMatcher(line) {
+ newIsland = group("island")
}
if (line == " Status: §r§9Guest") {
guesting = true