Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
hannibal002 committed Oct 13, 2024
1 parent 5c9522a commit 1dd4161
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@ object TerminalWaypoints {
@SubscribeEvent
fun onChat(event: LorenzChatEvent) {
if (!inBoss()) return
DungeonBossAPI.goldorTerminalPattern.matchMatcher(event.message) {
val playerName = group("playerName")
val playerEntity = EntityUtils.getEntities<EntityPlayerMP>().find { it.name == playerName } ?: return
val terminal = TerminalInfo.getClosestTerminal(playerEntity.getLorenzVec())
terminal?.highlight = false
}

val playerName = DungeonBossAPI.goldorTerminalPattern.matchMatcher(event.message) {
group("playerName")
} ?: return

val playerEntity = EntityUtils.getEntities<EntityPlayerMP>().find { it.name == playerName } ?: return
val terminal = TerminalInfo.getClosestTerminal(playerEntity.getLorenzVec())
terminal?.highlight = false
}

private fun inBoss() = DungeonAPI.inBossRoom && DungeonAPI.isOneOf("F7", "M7")
Expand Down

0 comments on commit 1dd4161

Please sign in to comment.