aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-03-04 15:39:39 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-03-04 15:39:39 +0100
commit3ca14b784cd41cf4fac5584b723edfa45fbd50d8 (patch)
treeddf784d184cf5cb04d529eb74545129e366e88af /src/main/java
parent6c505ea0565a1086e8196d807b7322b5c0b5dfc6 (diff)
downloadskyhanni-3ca14b784cd41cf4fac5584b723edfa45fbd50d8.tar.gz
skyhanni-3ca14b784cd41cf4fac5584b723edfa45fbd50d8.tar.bz2
skyhanni-3ca14b784cd41cf4fac5584b723edfa45fbd50d8.zip
Reactivated dungeon features
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonData.kt12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonData.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonData.kt
index b14bf4b4a..9b5430b93 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonData.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonData.kt
@@ -9,9 +9,12 @@ import at.hannibal2.skyhanni.utils.StringUtils.removeColor
import net.minecraftforge.event.world.WorldEvent
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import net.minecraftforge.fml.common.gameevent.TickEvent
+import java.util.regex.Pattern
class DungeonData {
+ private val pattern = Pattern.compile(" §7⏣ §cThe Catacombs §7\\((.*)\\)")
+
companion object {
var dungeonFloor: String? = null
var inBossRoom = false
@@ -63,13 +66,12 @@ class DungeonData {
fun onTick(event: TickEvent.ClientTickEvent) {
if (event.phase != TickEvent.Phase.START) return
if (dungeonFloor == null) {
- for (line in ScoreboardData.sidebarLines) {
- //TODO mixins
- if (line.contains("The Catacombs (")) {
- val floor = line.substringAfter("(").substringBefore(")")
+ for (line in ScoreboardData.sidebarLinesFormatted) {
+ val matcher = pattern.matcher(line)
+ if (matcher.matches()) {
+ val floor = matcher.group(1)
dungeonFloor = floor
DungeonEnterEvent(floor).postAndCatch()
- break
}
}
}